Actions
Bug #6891
closedProtected methods in a module can't call super
Status:
Closed
Assignee:
-
Target version:
-
ruby -v:
ruby 2.0.0dev (2012-08-19 trunk 36729) [x86_64-darwin12.0.0]
Backport:
Description
Since r36616 modules that have protected methods and are extended on to another class cannot call super. Here is an example:
module A
def inherited klass
super
end
end
module B
protected
def inherited klass
super
end
end
class C
extend B
extend A
end
class Z < C
end
Before r36616 this code would work, but after r36616 this code raises an exception. I've attached a test case.
Files
Updated by nobu (Nobuyoshi Nakada) over 11 years ago
- Status changed from Open to Closed
- % Done changed from 0 to 100
This issue was solved with changeset r36736.
Aaron, thank you for reporting this issue.
Your contribution to Ruby is greatly appreciated.
May Ruby be with you.
vm_insnhelper.c: iclass as klass in cfp
- vm_insnhelper.c (vm_call_method): follow iclasses as klass in cfp
but not included modules. [ruby-core:47241] [Bug #6891] - vm_insnhelper.c (vm_call_bmethod): pass defined_class to follow
proper ancestors. [ruby-core:47241] [Bug #6891]
Actions
Like0
Like0