Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[prototype] Remove redundant access modifier #1914

Merged
merged 1 commit into from
Aug 5, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions lib/rbs/prototype/runtime.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
20 changes: 0 additions & 20 deletions test/rbs/runtime_prototype_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -191,8 +187,6 @@ module IncludeTests
class ChildClass < ::RBS::RuntimePrototypeTest::IncludeTests::SuperClass
def self.foo: () -> untyped

public

def bar: () -> untyped

def foo: () -> untyped
Expand All @@ -201,8 +195,6 @@ def foo: () -> untyped
class SuperClass
def self.foo: () -> untyped

public

def foo: () -> untyped
end
end
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -592,8 +580,6 @@ class RuntimePrototypeTest < ::Test::Unit::TestCase
class DefineMethodAlias
def self.qux: () -> untyped

public

def bar: () -> untyped

private
Expand Down Expand Up @@ -664,8 +650,6 @@ class TodoClass

def self.singleton_todo: () -> untyped

public

def public_todo: () -> untyped

private
Expand All @@ -685,8 +669,6 @@ def private_todo: () -> untyped
module RBS
class RuntimePrototypeTest < ::Test::Unit::TestCase
module TodoModule
public

def public_todo: () -> untyped
end
end
Expand Down Expand Up @@ -953,8 +935,6 @@ class RuntimePrototypeTest < ::Test::Unit::TestCase
class Redefined
def self.constants: () -> untyped

public

def class: () -> untyped
end
end
Expand Down