-
-
Notifications
You must be signed in to change notification settings - Fork 942
Closed
Milestone
Description
How to replicate
Open up IRB in jRuby 9.0.4.0:
require "bigdecimal"; nil.to_s.to_d
=> #<BigDecimal:4d6025c5,'0.0',1(4)>Opening up IRB in Ruby 2.2.3:
require "bigdecimal"; nil.to_s.to_d
NoMethodError: undefined method `to_d' for "":String
from (irb):1
from /Users/ootoovak/.rubies/ruby-2.2.3/bin/irb:11:in `<main>'System
OS X 10.11.1
java version "1.8.0_60"
Java(TM) SE Runtime Environment (build 1.8.0_60-b27)
Java HotSpot(TM) 64-Bit Server VM (build 25.60-b23, mixed mode)
- To be clear I prefer jRuby's behaviour in this case but just wanted to point out the difference. In fact I would prefer to be able to do
nil.to_dgiven a choice.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels