The bare-leaf TNAME lookup in resolvealias used flat scopelookup,
which bucket-walks all matching names and returns whichever entry
hashed in first. Two modules each declaring `type invalid = ...`
collided in the same flat scope: utf8.invalid (`!void`) and
strconv.invalid (`!i32`) resolved to whichever registered first.
That drove a localloadop divergence at the 994/995 byte-id gates —
MOVSXD vs MOVQ — depending on which alias the checker happened
to pick for a given site.
Switch to scopelookupprefer(c.cur, c.curmod, nm), mirroring cstage
cmd/wcc/check.c:66 (scope_lookup_prefer at sym.c:103): when the
current module matches the bucket entry's b.mod, prefer it; else
fall back to first-found. The SK_USE→scopelookuptype fallback for
the #61 A.5 bare-TNAME-vs-imported-module collision case is
unchanged.
Six remaining bare-leaf scopelookup sites in this file (exprtype
N_IDENT, N_DOT-callee leaf, varianterr, scruttype, exprtypeoftry
N_IDENT + N_CALL, walker N_IDENT) are punted to #55 — this commit
fixes the path the reproducer surfaced and leaves the rest behind
an explicit follow-up so the byte-id corpus stays the test for
each conversion.