fix: allow lexical import shadowing
This commit is contained in:
@@ -3642,13 +3642,16 @@ fn cgdot(c: *cgen, n: *syntax.node) void = {
|
||||
// → inline the pre-computed constant. `pkg.Enum.MEMBER` keeps
|
||||
// `pkg` so enumlookupmod can prefer the explicit module on a
|
||||
// leaf collision; bare `Enum.MEMBER` falls back to c.curmod via
|
||||
// enumlookup's same-module-first walk.
|
||||
// enumlookup's same-module-first walk. A live local with the same
|
||||
// spelling wins before this name-only registry fallback; valid local
|
||||
// enum selectors were already folded by the checker.
|
||||
if (lhs != nil) {
|
||||
let etname: str;
|
||||
let etmod: str;
|
||||
etname.ptr = nil; etname.len = 0;
|
||||
etmod.ptr = nil; etmod.len = 0;
|
||||
if (lhs.kind == syntax.nkind.N_IDENT) {
|
||||
if (lhs.kind == syntax.nkind.N_IDENT
|
||||
&& localfindnode(c, lhs.str) == nil) {
|
||||
etname = lhs.str;
|
||||
};
|
||||
if (lhs.kind == syntax.nkind.N_DOT) {
|
||||
|
||||
Reference in New Issue
Block a user