Skip to content

Prepend breaks module "implementer" search #2864

@headius

Description

@headius

This code should work and it doesn't. This is the cause of the Rails master "each_with_index" bug when running tests:

module A
  def foo
    p 'ok'
  end
end

class X
  include A
end

class Y < X
end

module B
end

class Y
  prepend B
end

module A
  prepend B
end

Y.new.foo

I believe the problem is that our "findImplementer" logic for module methods ends up jumping above Enumerable in the search, due to the same module appearing in the hierarchy twice (due to lazy prepends).

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions