Skip to content

typing: resolve record projections from the record type#1043

Merged
strub merged 1 commit into
mainfrom
fix-1011
Jun 12, 2026
Merged

typing: resolve record projections from the record type#1043
strub merged 1 commit into
mainfrom
fix-1011

Conversation

@strub

@strub strub commented Jun 12, 2026

Copy link
Copy Markdown
Member

Field projections (e.f`) were resolved by looking up the field name as an operator, which requires the projection operator -- and hence the theory declaring the record type -- to be in scope. As a result, a projection through a type from a non-imported theory failed.

When the record type is known, resolve the projector directly from the type: the projection operator lives in the theory declaring the type and is reachable by its qualified name even when that theory is not imported. This also disambiguates same-named fields of unrelated records by type. Fall back to the name-based search only when the type is not yet known.

Closes #1011.

Field projections (e.`f) were resolved by looking up the field name as
an operator, which requires the projection operator -- and hence the
theory declaring the record type -- to be in scope. As a result, a
projection through a type from a non-imported theory failed.

When the record type is known, resolve the projector directly from the
type: the projection operator lives in the theory declaring the type and
is reachable by its qualified name even when that theory is not imported.
This also disambiguates same-named fields of unrelated records by type.
Fall back to the name-based search only when the type is not yet known.
@strub strub self-assigned this Jun 12, 2026
@strub strub requested a review from oskgo June 12, 2026 12:50
@strub strub added this pull request to the merge queue Jun 12, 2026
Merged via the queue into main with commit 767fb23 Jun 12, 2026
19 checks passed
@strub strub deleted the fix-1011 branch June 12, 2026 14:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Accept record projections without requiring type in Top

2 participants