[前][次][番号順一覧][スレッド一覧]

ruby-changes:52227

From: nagachika <ko1@a...>
Date: Sat, 18 Aug 2018 13:19:45 +0900 (JST)
Subject: [ruby-changes:52227] nagachika:r64435 (ruby_2_5): merge revision(s) 63112: [Backport #14818]

nagachika	2018-08-18 13:19:42 +0900 (Sat, 18 Aug 2018)

  New Revision: 64435

  https://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=64435

  Log:
    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@m...>

  Modified directories:
    branches/ruby_2_5/
  Modified files:
    branches/ruby_2_5/numeric.c
    branches/ruby_2_5/version.h
Index: ruby_2_5/numeric.c
===================================================================
--- ruby_2_5/numeric.c	(revision 64434)
+++ ruby_2_5/numeric.c	(revision 64435)
@@ -5272,10 +5272,11 @@ rb_int_s_isqrt(VALUE self, VALUE num) https://github.com/ruby/ruby/blob/trunk/ruby_2_5/numeric.c#L5272
  *   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.
  *
Index: ruby_2_5/version.h
===================================================================
--- ruby_2_5/version.h	(revision 64434)
+++ ruby_2_5/version.h	(revision 64435)
@@ -1,6 +1,6 @@ https://github.com/ruby/ruby/blob/trunk/ruby_2_5/version.h#L1
 #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
Index: ruby_2_5
===================================================================
--- ruby_2_5	(revision 64434)
+++ ruby_2_5	(revision 64435)

Property changes on: ruby_2_5
___________________________________________________________________
Modified: svn:mergeinfo
## -0,0 +0,1 ##
   Merged /trunk:r63112

--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/

[前][次][番号順一覧][スレッド一覧]