Closed
Description
This issue occurs when you have a include
or extend
method call inside a class/module, and an argument inside include
or extend
that uses a block, and define a method with parentheses inside the block. In such cases, future classes (A::C
and A::D
in the examples below) are missed by the parser.
Example failing code:
module A
class B
include(Module.new do
def e(m)
end
end)
end
class C
end
class D
end
end
Removing the parentheses when defining the method is sufficient to work around this bug:
module A
class B
include(Module.new do
def e m
end
end)
end
class C
end
class D
end
end
As is using a local variable for the Module.new
result and passing that to include:
module A
class B
m = Module.new do
def e(m)
end
end
include m
end
class C
end
class D
end
end
Here's another failing case showing the problem is not related to Module.new
or do
/end
vs {
/}
:
module A
class B
extend(e {
def f(g)
end
})
end
class C
end
class D
end
end
Metadata
Metadata
Assignees
Labels
No labels