Project

General

Profile

Actions

Bug #14232

closed

Unused refinement still breaks method search

Added by shugo (Shugo Maeda) almost 7 years ago. Updated over 6 years ago.

Status:
Closed
Target version:
-
[ruby-dev:50390]

Description

Given the following t.rb:

module A
  def foo
    puts "A#foo"
    super
  end
end

class B
  def foo
    puts "B#foo"
  end
end

class C < B
  include A

  def foo
    puts "C#foo"
    super
  end
end

module D
  refine A do
    def foo
    end
  end
end

C.new.foo

Even if D is not used, B#foo cannot be called by super in A#foo:

$ ruby t.rb
C#foo
A#foo
Traceback (most recent call last):
        2: from t.rb:30:in `<main>'
        1: from t.rb:19:in `foo'
t.rb:4:in `foo': super: no superclass method `foo' for #<C:0x00005623950b74f8> (NoMethodError)
Actions

Also available in: Atom PDF

Like0
Like0Like0Like0Like0Like0