diff options
author | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2012-08-06 02:34:36 +0000 |
---|---|---|
committer | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2012-08-06 02:34:36 +0000 |
commit | cc48423ead1d9e4b46dfeca7a45437793fc29521 (patch) | |
tree | 6fd5743695eeb2d7c0323e10938867ca60b68fe1 /test/ruby/test_defined.rb | |
parent | 7c5336b8f9f2e012194aed09658fdbeb3d6fe3de (diff) |
insns.def: use klass in cfp
* insns.def (defined): now should use klass in the current control
frame to search superclass, not me->klass. reported by naruse.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@36637 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test/ruby/test_defined.rb')
-rw-r--r-- | test/ruby/test_defined.rb | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/test/ruby/test_defined.rb b/test/ruby/test_defined.rb index 99c866fc2d..c02d1376b2 100644 --- a/test/ruby/test_defined.rb +++ b/test/ruby/test_defined.rb @@ -152,4 +152,22 @@ class TestDefined < Test::Unit::TestCase assert_equal("super", aa.f, bug6644) assert_nil(a.f, bug6644) end + + def test_super_in_included_method + c0 = Class.new do + def m + end + end + m1 = Module.new do + def m + defined?(super) + end + end + c = Class.new(c0) do include m1 + def m + super + end + end + assert_equal("super", c.new.m) + end end |