Skip to content

fix(hy-check): check shadowed package qualifier in TypeExpr::Named (HYB-E1002) (fixes #4004) - #4005

Open
bradwue313 wants to merge 1 commit into
limitlessprojects:mainfrom
bradwue313:fix/emit-guard-shadowed-qualified-type-pkg
Open

bradwue313 wants to merge 1 commit into
limitlessprojects:mainfrom
bradwue313:fix/emit-guard-shadowed-qualified-type-pkg

Conversation

@bradwue313

Copy link
Copy Markdown
Contributor

Fixes #4004

Changes

  • In compiler/crates/hy-check/src/emit_guard.rs:
    • In TypeExpr::Named, detect if the type has a package qualifier (pkg.Type) and verify whether pkg is shadowed by an in-scope local binding or parameter in st.env_lookup.
    • Emit HYB-E1002 when pkg is shadowed, matching Go's compile error {pkg} (variable) is not a package.
    • Correctly distinguish package qualifiers from type members so locals matching member names (mutex := 1; var m sync.Mutex) are not falsely rejected.
    • Maintain type shadowing checks for bare types and type arguments inside generic parameters ([...]).
  • Added regression test suite compiler/crates/hy-check/tests/shadowed_qualified_type_package.rs.

Settlement Coordinates

  • Author: @bradwue313
  • Settlement Wallet (USDC on Base): 0x38e0f40371be8b30f0909f890a1f701a25cd30cd
  • Solana USDC / SOL: CRdpAku2qovsPN2wGej5AbgMNtuhRQtq3GKFDFfMkJsv

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[buildable] hy-check(emit_guard): local binding shadowing package qualifier in qualified type not rejected (HYB-E1002, Row 13)

1 participant