From 033e4f3eb626ccd367ba1cac62302d5116b3cb60 Mon Sep 17 00:00:00 2001 From: ksss Date: Sat, 29 Jun 2024 07:49:05 +0900 Subject: [PATCH] Remove redundant access modifier --- lib/rbs/prototype/runtime.rb | 2 -- test/rbs/runtime_prototype_test.rb | 20 -------------------- 2 files changed, 22 deletions(-) diff --git a/lib/rbs/prototype/runtime.rb b/lib/rbs/prototype/runtime.rb index 343660ae8..2022e0f5d 100644 --- a/lib/rbs/prototype/runtime.rb +++ b/lib/rbs/prototype/runtime.rb @@ -332,8 +332,6 @@ def generate_methods(mod, module_name, members) public_instance_methods = mod.public_instance_methods.select {|name| target_method?(mod, instance: name) } unless public_instance_methods.empty? - members << AST::Members::Public.new(location: nil) - public_instance_methods.sort.each do |name| method = mod.instance_method(name) next if todo_object&.skip_instance_method?(module_name: module_name_absolute, method: method, accessibility: :public) diff --git a/test/rbs/runtime_prototype_test.rb b/test/rbs/runtime_prototype_test.rb index 2be2f7985..3958fa9ce 100644 --- a/test/rbs/runtime_prototype_test.rb +++ b/test/rbs/runtime_prototype_test.rb @@ -76,8 +76,6 @@ def self.b: () -> untyped def self.baz: () { (*untyped) -> untyped } -> untyped - public - alias bar foo def foo: (untyped foo, ?untyped bar, *untyped baz, untyped a, b: untyped, ?c: untyped, **untyped) -> untyped @@ -145,8 +143,6 @@ def self.b: () -> untyped def self.baz: () { (*untyped) -> untyped } -> untyped - public - alias bar foo def foo: (untyped foo, ?untyped bar, *untyped baz, untyped a, b: untyped, ?c: untyped, **untyped) -> untyped @@ -191,8 +187,6 @@ module IncludeTests class ChildClass < ::RBS::RuntimePrototypeTest::IncludeTests::SuperClass def self.foo: () -> untyped - public - def bar: () -> untyped def foo: () -> untyped @@ -201,8 +195,6 @@ def foo: () -> untyped class SuperClass def self.foo: () -> untyped - public - def foo: () -> untyped end end @@ -266,8 +258,6 @@ def test_argument_forwarding module RBS class RuntimePrototypeTest < ::Test::Unit::TestCase class TestForArgumentForwarding - public - def foo: (*untyped) { (*untyped) -> untyped } -> untyped end end @@ -416,8 +406,6 @@ def test_for_yield module RBS class RuntimePrototypeTest < ::Test::Unit::TestCase class TestForYield - public - def m1: () { () -> untyped } -> untyped def m2: () { (untyped) -> untyped } -> untyped @@ -592,8 +580,6 @@ class RuntimePrototypeTest < ::Test::Unit::TestCase class DefineMethodAlias def self.qux: () -> untyped - public - def bar: () -> untyped private @@ -664,8 +650,6 @@ class TodoClass def self.singleton_todo: () -> untyped - public - def public_todo: () -> untyped private @@ -685,8 +669,6 @@ def private_todo: () -> untyped module RBS class RuntimePrototypeTest < ::Test::Unit::TestCase module TodoModule - public - def public_todo: () -> untyped end end @@ -953,8 +935,6 @@ class RuntimePrototypeTest < ::Test::Unit::TestCase class Redefined def self.constants: () -> untyped - public - def class: () -> untyped end end