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

Fix map type name warnings due to unused block #2247

Open
bkuhlmann opened this issue Jan 20, 2025 · 0 comments · May be fixed by #2248
Open

Fix map type name warnings due to unused block #2247

bkuhlmann opened this issue Jan 20, 2025 · 0 comments · May be fixed by #2248

Comments

@bkuhlmann
Copy link

Why

Hello. 👋 I'm seeing the following strict_unused_block category of warning show up when launching an IRB session:

/Users/bkuhlmann/.cache/frum/versions/3.4.1/lib/ruby/gems/3.4.0/gems/rbs-3.8.1/lib/rbs/environment.rb:793: warning: the block passed to 'map_type_name' defined at /Users/bkuhlmann/.cache/frum/versions/3.4.1/lib/ruby/gems/3.4.0/gems/rbs-3.8.1/lib/rbs/types.rb:18 may be ignored
/Users/bkuhlmann/.cache/frum/versions/3.4.1/lib/ruby/gems/3.4.0/gems/rbs-3.8.1/lib/rbs/types.rb:376: warning: the block passed to 'map_type_name' defined at /Users/bkuhlmann/.cache/frum/versions/3.4.1/lib/ruby/gems/3.4.0/gems/rbs-3.8.1/lib/rbs/types.rb:18 may be ignored
/Users/bkuhlmann/.cache/frum/versions/3.4.1/lib/ruby/gems/3.4.0/gems/rbs-3.8.1/lib/rbs/types.rb:779: warning: the block passed to 'map_type_name' defined at /Users/bkuhlmann/.cache/frum/versions/3.4.1/lib/ruby/gems/3.4.0/gems/rbs-3.8.1/lib/rbs/types.rb:18 may be ignored
/Users/bkuhlmann/.cache/frum/versions/3.4.1/lib/ruby/gems/3.4.0/gems/rbs-3.8.1/lib/rbs/types.rb:688: warning: the block passed to 'map_type_name' defined at /Users/bkuhlmann/.cache/frum/versions/3.4.1/lib/ruby/gems/3.4.0/gems/rbs-3.8.1/lib/rbs/types.rb:18 may be ignored
/Users/bkuhlmann/.cache/frum/versions/3.4.1/lib/ruby/gems/3.4.0/gems/rbs-3.8.1/lib/rbs/types.rb:1444: warning: the block passed to 'map_type_name' defined at /Users/bkuhlmann/.cache/frum/versions/3.4.1/lib/ruby/gems/3.4.0/gems/rbs-3.8.1/lib/rbs/types.rb:18 may be ignored
/Users/bkuhlmann/.cache/frum/versions/3.4.1/lib/ruby/gems/3.4.0/gems/rbs-3.8.1/lib/rbs/types.rb:1034: warning: the block passed to 'map_type_name' defined at /Users/bkuhlmann/.cache/frum/versions/3.4.1/lib/ruby/gems/3.4.0/gems/rbs-3.8.1/lib/rbs/types.rb:18 may be ignored

The problem is map_type_name doesn't make use of a block and should be refactored so the warnings goes away.

How

To recreate, run:

export RUBYOPT="-W:strict_unused_block"
irb

Notes

Here's my environment:

  • Ruby: ruby 3.4.1 (2024-12-25 revision 48d4efcb85) +YJIT +PRISM [arm64-darwin24.2.0]
  • RBS: 3.8.1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging a pull request may close this issue.

1 participant