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

ruby-changes:70165

From: Koichi <ko1@a...>
Date: Mon, 13 Dec 2021 10:24:10 +0900 (JST)
Subject: [ruby-changes:70165] 5164c2b36f (master): Pass UnboundMethod to 2nd arg of define_method

https://git.ruby-lang.org/ruby.git/commit/?id=5164c2b36f

From 5164c2b36f66e7b1d2e0f908663ee3f3a3830605 Mon Sep 17 00:00:00 2001
From: Koichi Sasada <ko1@a...>
Date: Mon, 13 Dec 2021 02:11:05 +0900
Subject: Pass UnboundMethod to 2nd arg of define_method

---
 test/ruby/test_struct.rb | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/test/ruby/test_struct.rb b/test/ruby/test_struct.rb
index 5a39ecc3aa3..176e2ac5dec 100644
--- a/test/ruby/test_struct.rb
+++ b/test/ruby/test_struct.rb
@@ -503,7 +503,7 @@ module TestStruct https://github.com/ruby/ruby/blob/trunk/test/ruby/test_struct.rb#L503
     assert_equal 1, klass.instance_method(:a=).arity
 
     klass.module_eval do
-      define_method(:b=, &klass.new.method(:a=).to_proc)
+      define_method(:b=, instance_method(:a=))
       alias c= a=
     end
 
@@ -518,7 +518,7 @@ module TestStruct https://github.com/ruby/ruby/blob/trunk/test/ruby/test_struct.rb#L518
     assert_equal [[:req, :_]], klass.instance_method(:a=).parameters
 
     klass.module_eval do
-      define_method(:b=, &klass.new.method(:a=).to_proc)
+      define_method(:b=, instance_method(:a=))
       alias c= a=
     end
 
-- 
cgit v1.2.1


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

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