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 @@ -39,6 +39,7 @@ Bug fixes:
39
39
* ` Kernel#sprintf ` encoding validity has been fixed (#1852 , @XrXr ).
40
40
* Fixed File.fnmatch causes ArrayIndexOutOfBoundsException (#1845 ).
41
41
* Make ` String#concat ` work with no or multiple arguments (#1519 ).
42
+ * Implement Numeric#clone method to return self.
42
43
43
44
Compatibility:
44
45
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