rbs
rbs copied to clipboard
Fix name resolver for class/module-alias
Fix https://github.com/ruby/rbs/issues/2293
Before
module M
module N
end
# 2. Found the `::M::N2` and search the the `N`(`entry.decl.old_name`).
# 3. The `::N` is nothing.
module N2 = N
end
class C
# 1. Validate command search the `::M::N2`
# 4. Report "The `M::N2` is not found".
include M::N2
end
After
module M
module N
end
# 2. Found `::M::N2` and search the `N`.
# 3. `::N` is nothing.
# 4. Search the `::M::N`. (from `entry.outer`)
# 5. Found the `::M::N`.
module N2 = N
end
class C
# 1. Validate command search the `::M::N2`
# 6. `M::N2` resolved by `::M::N`.
include M::N2
end