File tree Expand file tree Collapse file tree 3 files changed +6
-5
lines changed
src/main/ruby/truffleruby/core Expand file tree Collapse file tree 3 files changed +6
-5
lines changed Original file line number Diff line number Diff line change @@ -46,6 +46,7 @@ Bug fixes:
46
46
* Fixed issue with ` SystemCallError.new ` setting a backtrace.
47
47
* Fixed ` BigDecimal#to_s ` formatting issue (#1711 ).
48
48
* Run ` END ` keyword block only once at exit.
49
+ * Implement Numeric#clone method to return self.
49
50
50
51
Compatibility:
51
52
Original file line number Diff line number Diff line change @@ -3,5 +3,3 @@ fails:Kernel#clone returns true for TrueClass
3
3
fails:Kernel#clone returns false for FalseClass
4
4
fails:Kernel#clone returns the same Integer for Integer
5
5
fails:Kernel#clone returns the same Symbol for Symbol
6
- fails:Kernel#clone returns self for Complex
7
- fails:Kernel#clone returns self for Rational
Original file line number Diff line number Diff line change 29
29
class Numeric
30
30
include Comparable
31
31
32
- # Always raises TypeError, as dup'ing Numerics is not allowed.
33
- def initialize_copy ( other )
34
- raise TypeError , "copy of #{ self . class } is not allowed"
32
+ def clone ( freeze : true )
33
+ unless freeze
34
+ raise ArgumentError , "can't unfreeze #{ self . class . name } "
35
+ end
36
+ self
35
37
end
36
38
37
39
def +@
You can’t perform that action at this time.
0 commit comments