Details
-
Type:
Improvement
-
Status:
Closed
-
Priority:
Minor
-
Resolution: Fixed
-
Affects Version/s: None
-
Fix Version/s: JRuby 0.9.8
-
Component/s: Core Classes/Modules
-
Labels:None
-
Environment:jruby-trunk/windows/linux/jdk6
Description
MRI desn't allow defining singleton methods for Floats and Bignums
class << 10.0
def singleton
end
end
either
class << 1000000000000000000000
def singleton
end
end
MRI: can't define singleton method "singleton" for Float (TypeError)
Patch with test cases. This patch highlights a separate issue:
class << 10
end
should fail with "TypeError: no virtual class for Fixnum" (according to MRI) but instead succeeds. I will raise a separate patch.