Bugs: Browse | Submit New | Admin

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

Date:
2008-03-28 12:47
Priority:
3
Submitted By:
oksteev (oksteev)
Assigned To:
Shyouhei Urabe (shyouhei)
Category:
Language / Runtime / Core Libraries
State:
Open
Platform:
 
Summary:
"no superclass method" raised when calling super from an aliased method included from a module (when method was aliased from inside the module)

Detailed description
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.

- steve
http://coderrr.wordpress.com

Add A Comment: Notepad

Please login


Followup

Message
Date: 2008-11-07 18:08
Sender: Roger Pack

looks like it's still a bug.

Could you submit a new copy to the new tracker:
http://redmine.ruby-lang.org/
--this tracker is being shelved.
Thanks!
-=R

Attached Files:

Name Description Download
No Files Currently Attached

Changes:

No Changes Have Been Made to This Item