Project

General

Profile

Actions

Bug #14068

closed

Unused refinement breaks method search

Added by mame (Yusuke Endoh) about 7 years ago. Updated almost 7 years ago.

Status:
Closed
Target version:
ruby -v:
ruby 2.5.0dev (2017-10-30 trunk 60565) [x86_64-linux]
[ruby-core:83613]

Description

The following is an expected behavior.

module M1
  def foo
    p "M1#foo"
  end
end

module M2
end

include M1
include M2
foo() #=> "M1#foo"

But, defining UnusedRefinement that refines M2, breaks the behavior, even if it is entirely not used.

module M1
  def foo
    p "M1#foo"
  end
end

module M2
end

module UnusedRefinement # <=== INSERTED
  refine(M2) do
    def foo
      p "M2#foo"
    end
  end
end

include M1
include M2
foo() #=> test.rb:20:in `<main>': undefined method `foo' for main:Object (NoMethodError)
Actions

Also available in: Atom PDF

Like0
Like0Like0Like0Like0