Seems like the warnings from unused block variables aren't aligned with MRI,
sample script:
ary = { a: [1, [:one]] }
ary.flat_map do |key, (val1, val2)|
[key] + val2
end
JRuby warns on unused val1, in $VERBOSE mode:
jruby 10.0.2.0 (3.4.2) 2025-08-07 cba6031bd0 OpenJDK 64-Bit Server VM 21.0.2+13-58 on 21.0.2+13-58 +indy +jit [x86_64-linux]
script.rb:4: warning: assigned but unused variable - val1
jruby 9.4.11.0 (3.1.4) 2025-01-29 9b107851a3 OpenJDK 64-Bit Server VM 21.0.2+13-58 on 21.0.2+13-58 +jit [x86_64-linux]
script.rb:4: warning: assigned but unused variable - val1
MRI no warnings on unused val1:
ruby 3.1.4p223 (2023-03-30 revision 957bb7cb81) [x86_64-linux]
Exception `LoadError' at /opt/local/rvm/rubies/ruby-3.1.4/lib/ruby/3.1.0/rubygems.rb:1323 - cannot load such file -- rubygems/defaults/operating_system
Exception `LoadError' at /opt/local/rvm/rubies/ruby-3.1.4/lib/ruby/3.1.0/rubygems.rb:1340 - cannot load such file -- rubygems/defaults/ruby
ruby 3.4.6 (2025-09-16 revision dbd83256b1) +PRISM [x86_64-linux]
Exception 'LoadError' at /opt/local/rvm/rubies/ruby-3.4.6/lib/ruby/3.4.0/rubygems.rb:1379 - cannot load such file -- rubygems/defaults/operating_system
Exception 'LoadError' at /opt/local/rvm/rubies/ruby-3.4.6/lib/ruby/3.4.0/rubygems.rb:1396 - cannot load such file -- rubygems/defaults/ruby
Seems like the warnings from unused block variables aren't aligned with MRI,
sample script:
JRuby warns on unused
val1, in$VERBOSEmode:MRI no warnings on unused
val1: