Environment Information
jruby 10.0.3.0-SNAPSHOT (3.4.5) 2025-11-30 ffffffffff OpenJDK 64-Bit Server VM 21.0.9+10 on 21.0.9+10 +indy +jit [x86_64-linux] (master branch)
Linux 6.18.4-1-MANJARO #1 SMP PREEMPT_DYNAMIC Thu, 08 Jan 2026 12:46:08 +0000 x86_64 GNU/Linux
Expected Behavior
Running the following code should output 0.1e2:
jruby <<RUBY
begin
# forgot to require "bigdecimal"
BigDecimal(10)
rescue
# oops, an error happens
end
require "bigdecimal"
puts BigDecimal(10)
RUBY
This can also be more reasonably done in an interactive irb session.
Actual Behavior
BigDecimal() doesn't get installed by require:
NoMethodError: undefined method 'BigDecimal' for main
<main> at -:6
However, this works correctly:
jruby <<RUBY
require "bigdecimal"
puts BigDecimal(10)
RUBY
# => 0.1e2
I'm not sure if the problem is in Kernel or main, as in both cases Kernel.methods.include?(:BigDecimal) is true and self.methods.include?(:BigDecimal) is false. Testing with defined?(BigDecimal(10)) fails in the problematic case and returns method in working case.
Environment Information
jruby 10.0.3.0-SNAPSHOT (3.4.5) 2025-11-30 ffffffffff OpenJDK 64-Bit Server VM 21.0.9+10 on 21.0.9+10 +indy +jit [x86_64-linux](masterbranch)Linux 6.18.4-1-MANJARO #1 SMP PREEMPT_DYNAMIC Thu, 08 Jan 2026 12:46:08 +0000 x86_64 GNU/LinuxExpected Behavior
Running the following code should output
0.1e2:This can also be more reasonably done in an interactive
irbsession.Actual Behavior
BigDecimal()doesn't get installed byrequire:However, this works correctly:
I'm not sure if the problem is in
Kernelormain, as in both casesKernel.methods.include?(:BigDecimal)istrueandself.methods.include?(:BigDecimal)isfalse. Testing withdefined?(BigDecimal(10))fails in the problematic case and returnsmethodin working case.