Repository navigation
hy-check: resolve [N]T, map[K]V, and option[T] in generic struct field kinds (fixes #3705) - #3706
Merged
limitlessprojects merged 4 commits intoNov 5, 2026
Conversation
Owner
Landed:
|
This was referenced Nov 5, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #3705
Summary
Resolves Row 13 (
BUILDABLE) false-accepts when a generic struct field is instantiated with a fixed-size array ([N]T), map (map[K]V), option (option[T]), or typed scalar container ([]i64,[N]i64,map[K]i64):Collector::kind_of_type_str: Routes composite type spellings throughCompFamily::split(covering[N]T,map[K]V,[]T,*T, andchan T) and handlesoption[T]before falling back tokind_of_named.Collector::struct_field_container_elem_scalar: Resolves container element/value numeric scalars when the struct field is a generic type parameter (TypeExpr::Named) instantiated with a slice, array, or map.Collector::map_key_scalar_name&Collector::typed_value_type_name: Extend resolution toExpr::Fieldso map key scalar width checks (b.val[k64]onbox[map[i32]int]) and fixed-size array length comparisons (var a [2]int = b.valonbox[[3]int]) work through struct field projections.Verification
compiler/crates/hy-check/tests/buildable_generic_struct_composite_fields_3705.rscovering all 7 reject cases + valid in-bounds controls.cargo test -p hy-checkpasses with 0 regressions.Settlement Rail: USDC on Base Mainnet (Chain ID 8453)
Settlement Wallet:
0x8366bCe3a2D379De7656D7A67015789FaF999f20