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

Prevent a warning: the block passed to 'map_type_name' .. may be ignored #2248

Merged
merged 3 commits into from
Jan 24, 2025
Merged
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
4 changes: 2 additions & 2 deletions lib/rbs/types.rb
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ def sub(s)
end

module NoTypeName
def map_type_name
def map_type_name(&)
self
end
end
Expand Down Expand Up @@ -229,7 +229,7 @@ def to_s(level = 0)

include EmptyEachType

def map_type_name
def map_type_name(&)
ClassSingleton.new(
name: yield(name, location, self),
Comment on lines +232 to 234
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
def map_type_name(&)
ClassSingleton.new(
name: yield(name, location, self),
def map_type_name(&blk)
ClassSingleton.new(
name: blk.(name, location, self),

location: location
Expand Down
Loading