Skip to content

Method#super_method finds something when super is undef'ed #2155

@headius

Description

@headius

The last assertion in this test (from mri/ruby/test_method.rb) fails:

  def test_super_method_removed
    c1 = Class.new {private def foo; end}
    c2 = Class.new(c1) {public :foo}
    c3 = Class.new(c2) {def foo; end}
    c1.class_eval {undef foo}
    m = c3.instance_method(:foo)
    m = assert_nothing_raised(NameError, Feature9781) {break m.super_method}
    assert_nil(m, Feature9781)
  end

undef installs an UndefinedMethod, and Method#super_method checks for UndefinedMethod, so I'm not sure what's broken here. Here's the output

TestMethod#test_super_method_removed [/Users/headius/projects/jruby/test/mri/ruby/test_method.rb:857]:
[ruby-core:62202] [Feature #9781].
Expected #<UnboundMethod: #<Class:0x36c56a77>#foo> to be nil.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions