Project

General

Profile

This project is closed and read-only.

Actions

Backport #734

closed

"no superclass method" raised when calling super from an aliased method included from a module (when method was aliased from inside the module)

Backport #734: "no superclass method" raised when calling super from an aliased method included from a module (when method was aliased from inside the module)

Added by coderrr (coderrr .) almost 18 years ago. Updated about 7 years ago.


Description

=begin
Summary:

Initial Comment:
class A
def a
:a
end
end

module M
def a
super
end
alias_method :b, :a
end

class B < A
include M
end

p B.new.a => :a
p B.new.b # in b': super: no superclass method a' (NoMethodError)

If you alias a method defined in a module (aliasing the method inside of the module) then calls to super inside that method will no longer work.

This error only occurs in ruby 1.8, it functions correctly in 1.9.
=end

Updated by shyouhei (Shyouhei Urabe) over 17 years ago Actions #1

  • Assignee set to nobu (Nobuyoshi Nakada)

=begin

=end

Updated by shyouhei (Shyouhei Urabe) about 16 years ago Actions #2

  • Status changed from Open to Assigned
  • ruby -v set to 1.8.x

=begin

=end

Updated by jeremyevans0 (Jeremy Evans) about 7 years ago Actions #3

  • Tracker changed from Bug to Backport
  • Project changed from 2 to 5
  • Description updated (diff)
  • Status changed from Assigned to Closed
  • ruby -v deleted (1.8.x)
Actions

Also available in: PDF Atom