Conversation
Collaborator
Author
This stack of pull requests is managed by Graphite. Learn more about stacking. |
This was referenced Apr 29, 2026
…ct/tuple member access
e0ec9a0 to
22810ca
Compare
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.

Summary
Introduces
TypeMemberandTypeMemberKindas a unified abstraction over named struct members and positional tuple elements. Adds a newtype_membersquery (backed bytype_members_query) that returns a type's accessible members keyed by their access name — struct member names for structs, and stringified indices ("0", "1", ...) for tuples. UpdatesEnrichedTypeMemberAccessandEnrichedMembersto useTypeMemberinstead ofMember, and updatesmember_access_exprandget_enriched_type_member_accessto go through the newtype_membersquery rather than callingconcrete_struct_membersdirectly.Type of change
Please check one:
Why is this change needed?
Previously, member access resolution only handled concrete struct types by calling
concrete_struct_membersdirectly, with no shared abstraction for tuple element access. This made it impossible to unify member access logic across structs and tuples, and left tuple element access (e.g.,my_tuple.0) unsupported through the enriched member access path.What was the behavior or documentation before?
Member access enrichment operated exclusively on
concrete_struct_members, returningMembervalues. Tuple types returned an empty map by default, and there was noTypeMemberabstraction to distinguish between struct members and tuple elements.What is the behavior or documentation after?
A new
TypeMemberstruct andTypeMemberKindenum unify struct members and tuple elements. Thetype_membersquery returns members for both structs and tuples. The enriched member access path now usesTypeMemberthroughout. Tuple element access via numeric index names is structurally supported, with full handling gated behind a TODO referencing issue #7608.Related issue or discussion (if any)
#7608
Additional context
The
member_access_exprfunction currently returnsUnsupportedforTypeMemberKind::TupleElementaccesses, as noted by theTODO(#7608)comment. The groundwork laid here is intended to be completed in that follow-up.