wcc: kind-filter type-position name resolution so a value can't shadow a same-named type (#225)
resolve_typename used the kind-blind scope_lookup_prefer, so a same-named value binding (param/let) in a closer scope hid the type it shadowed, wrongly rejecting valid Hare like 'fn f(off: off)'. wwstage already separates type/value namespaces; this aligns the cstage frontend up. New scope_lookup_type skips non-SK_TYPE syms and keeps scanning, preserving same-module preference. Byte-id-neutral: the new branch fires only on the old 'unknown type' error path.
This commit is contained in:
@@ -65,7 +65,9 @@ resolve_typename(Checker *c, Node *n)
|
||||
const char *nm = n->str;
|
||||
Type *bi = lookup_builtin(nm);
|
||||
if (bi) return bi;
|
||||
Sym *s = scope_lookup_prefer(c->cur, c->cur_mod, nm);
|
||||
/* #225: kind-filtered so a same-named value binding (param/let/fn)
|
||||
* in a closer scope can't hide the type binding it shadows. */
|
||||
Sym *s = scope_lookup_type(c->cur, c->cur_mod, nm);
|
||||
if (s == NULL && nm) {
|
||||
/* module-qualified: io.stream → strip the last dot prefix
|
||||
* and look up the leaf, filtering on the importing module's
|
||||
|
||||
Reference in New Issue
Block a user