Project

General

Profile

Actions

Bug #14232

closed

Unused refinement still breaks method search

Bug #14232: Unused refinement still breaks method search

Added by shugo (Shugo Maeda) almost 8 years ago. Updated over 7 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) 

Updated by nobu (Nobuyoshi Nakada) almost 8 years ago Actions #1

  • Status changed from Assigned to Closed

Applied in changeset trunk|r61484.


vm_method.c: fix super in refined module

  • vm_method.c (rb_method_entry_complement_defined_class): clone
    the original method entry of refined module instance method with
    the active ICLASS, to track super method chain.
    [ruby-dev:50390] [Bug #14232]

Updated by nagachika (Tomoyuki Chikanaga) almost 8 years ago Actions #2

  • Backport changed from 2.3: UNKNOWN, 2.4: UNKNOWN, 2.5: UNKNOWN to 2.3: REQUIRED, 2.4: REQUIRED, 2.5: REQUIRED

Updated by nagachika (Tomoyuki Chikanaga) almost 8 years ago Actions #3 [ruby-dev:50417]

  • Backport changed from 2.3: REQUIRED, 2.4: REQUIRED, 2.5: REQUIRED to 2.3: DONTNEED, 2.4: REQUIRED, 2.5: REQUIRED

You cannot refine Module on 2.3.x.
I set DONTNEED for 2.3.

Updated by nagachika (Tomoyuki Chikanaga) almost 8 years ago Actions #4 [ruby-dev:50471]

  • Backport changed from 2.3: DONTNEED, 2.4: REQUIRED, 2.5: REQUIRED to 2.3: DONTNEED, 2.4: DONE, 2.5: REQUIRED

ruby_2_4 r62234 merged revision(s) 61484.

Updated by naruse (Yui NARUSE) over 7 years ago Actions #5 [ruby-dev:50481]

  • Backport changed from 2.3: DONTNEED, 2.4: DONE, 2.5: REQUIRED to 2.3: DONTNEED, 2.4: DONE, 2.5: DONE

ruby_2_5 r62511 merged revision(s) 61484.

Actions

Also available in: PDF Atom