-
-
Notifications
You must be signed in to change notification settings - Fork 942
Closed
Milestone
Description
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/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)
RUBYThis 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.1e2I'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.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels