1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

Pass UnboundMethod to 2nd arg of define_method

This commit is contained in:
Koichi Sasada 2021-12-13 02:11:05 +09:00
parent fdfb43b2b1
commit 5164c2b36f
Notes: git 2021-12-13 10:24:23 +09:00

View file

@ -503,7 +503,7 @@ module TestStruct
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
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