diff options
author | ko1 <ko1@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2008-12-24 11:47:00 +0000 |
---|---|---|
committer | ko1 <ko1@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2008-12-24 11:47:00 +0000 |
commit | 0b844c130a2ddbf64d27cfcf3ff4681038ed8847 (patch) | |
tree | 8989f7e0eb41ecf20b74c9551687b06f28f010e4 /bootstraptest | |
parent | ad9a4e2bcbbafccedd62ed8e5fb936b0b70f7d19 (diff) | |
download | ruby-0b844c130a2ddbf64d27cfcf3ff4681038ed8847.tar.gz ruby-0b844c130a2ddbf64d27cfcf3ff4681038ed8847.tar.xz ruby-0b844c130a2ddbf64d27cfcf3ff4681038ed8847.zip |
* vm_insnhelper.c (vm_call_method): use class of method defined
instead of receiver's class on bmethod. fixes [ruby-core:20786]
* bootstraptest/test_method.rb: add a test for above.
* vm_insnhelper.c (vm_setup_method): remove unused parameter klass.
* vm_insnhelper.h (CALL_METHOD): ditto.
* insns.def, vm_eval.c: ditto.
git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@20967 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'bootstraptest')
-rw-r--r-- | bootstraptest/test_method.rb | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/bootstraptest/test_method.rb b/bootstraptest/test_method.rb index 33e7436e6..fff484db7 100644 --- a/bootstraptest/test_method.rb +++ b/bootstraptest/test_method.rb @@ -1084,3 +1084,22 @@ assert_equal '[1, [:foo, 3, 4, :foo]]', %q{ a = b = [:foo] regular(1, *a, *[3, 4], *b) } + +assert_equal '["B", "A"]', %q{ + class A + def m + 'A' + end + end + + class B < A + define_method(:m) do + ['B', super()] + end + end + + class C < B + end + + C.new.m +} |