Skip to content

fix(hy-emit): walk select arm headers, assign target places, and array lengths in comparable inference - #2132

Open
RPMFAN wants to merge 1 commit into
limitlessprojects:mainfrom
RPMFAN:cursor/comparable-select-place-c3d9
Open

RPMFAN wants to merge 1 commit into
limitlessprojects:mainfrom
RPMFAN:cursor/comparable-select-place-c3d9

Conversation

@RPMFAN

@RPMFAN RPMFAN commented Oct 28, 2026

Copy link
Copy Markdown

Closes #2127

Summary

Fixes GUARANTEES.md Row 13 BUILDABLE when a generic type parameter k is used as a map[k]v key or set[k] element only inside select arm header expressions, assignment target places, or array length expressions:

  • Walk SelectArmKind::Send { chan, value, .. } and SelectArmKind::Recv { chan, .. } inside Stmt::Select in Emitter::collect_comparable_in_stmt (compiler/crates/hy-emit/src/lib.rs).
  • Walk targets (PlaceKind::Index, PlaceKind::Deref, PlaceKind::Member) inside Stmt::Assign.
  • Walk len: Option<Box<Expr>> inside TypeExpr::Array in Emitter::collect_comparable_in_ty.
  • Add regression tests in compiler/crates/hy-emit/tests/comparable_select_and_place.rs.

Verification

  • cargo test -p hy-emit: passed.

Payout Wallet (USDC on Base / EVM): 0x26AB46a0309C3ab8F2f59754B3066e77E8154A34

… array lengths

A type parameter used as a map key or set element only inside a select
arm, an assignment place, or an array length was emitted as any, so
go build rejected the key. Walk those positions when choosing the constraint.

Co-authored-by: RPMFAN <RPMFAN@users.noreply.github.com>
@github-actions github-actions Bot added the bot:land-candidate Shepherd: fresh, gate-clean, verifiable (set from classify()) label Oct 28, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bot:land-candidate Shepherd: fresh, gate-clean, verifiable (set from classify())

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[buildable] hy-emit: generic comparable inference skips select arm headers, assign target places, and array lengths

2 participants