diff options
author | nagachika <nagachika@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2018-08-18 04:19:42 +0000 |
---|---|---|
committer | nagachika <nagachika@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2018-08-18 04:19:42 +0000 |
commit | a814ab9efc82d0505350c7f0f04d565eaa9c53a4 (patch) | |
tree | 089a699992cc9bcb8a308726e2fb482cff4c01ae | |
parent | 99d1f2c5dc02dbeac42b4d27e4798774133c618a (diff) | |
download | ruby-a814ab9efc82d0505350c7f0f04d565eaa9c53a4.tar.gz |
merge revision(s) 63112: [Backport #14818]
Remove outdated example from Numeric documentation
Since 2.5, Numeric instances can be cloned and duplicated.
[Fix GH-1850]
From: Miguel Landaeta <miguel@miguel.cc>
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_2_5@64435 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r-- | numeric.c | 7 | ||||
-rw-r--r-- | version.h | 2 |
2 files changed, 5 insertions, 4 deletions
@@ -5272,10 +5272,11 @@ rb_int_s_isqrt(VALUE self, VALUE num) * 1.object_id == a.object_id #=> true * * There can only ever be one instance of the integer +1+, for example. Ruby ensures this - * by preventing instantiation and duplication. + * by preventing instantiation. If duplication is attempted, the same instance is returned. * - * Integer.new(1) #=> NoMethodError: undefined method `new' for Integer:Class - * 1.dup #=> TypeError: can't dup Integer + * Integer.new(1) #=> NoMethodError: undefined method `new' for Integer:Class + * 1.dup #=> 1 + * 1.object_id == 1.dup.object_id #=> true * * For this reason, Numeric should be used when defining other numeric classes. * @@ -1,6 +1,6 @@ #define RUBY_VERSION "2.5.2" #define RUBY_RELEASE_DATE "2018-08-18" -#define RUBY_PATCHLEVEL 77 +#define RUBY_PATCHLEVEL 78 #define RUBY_RELEASE_YEAR 2018 #define RUBY_RELEASE_MONTH 8 |