ISyntaxCheck: build ATF equivalences from canonical qualified tycons#1051
Open
nanavati wants to merge 1 commit into
Open
ISyntaxCheck: build ATF equivalences from canonical qualified tycons#1051nanavati wants to merge 1 commit into
nanavati wants to merge 1 commit into
Conversation
ISyntaxCheck.atfEqsFromDict built associated-type-function tycons from raw getAllTypes enumeration keys. The symtab type map holds one entry per visible alias of a type -- for the current package's own decls both the qualified name and the bare one, sharing a single TypeInfo -- so each dict addition also manufactured a duplicate equivalence keyed by an unqualified ATF tycon (first seen: Rep alongside Prelude.Rep, during the Prelude's own compile). Every other ITCon producer feeds from CTypes canonicalized by MakeSymTab.trCType', which substitutes the qualified ti_qual_id, so real ATF applications always carry qualified tycon Ids. The unqualified duplicates could never match them in eqType: they sat in the equivalence classes as silently inert entries. Build the ATF tycon from ti_qual_id and keep one entry per ATF by matching only the canonical alias (atfId == qatfId). Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Vjo7EmAfHvZTWPDJ923FVz
This was referenced Jul 15, 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.
What
ISyntaxCheck.atfEqsFromDictbuilds associated-type-function tycons from raw symtabenumeration keys. The symtab type map holds one entry per visible alias of a type — for
the current package's own decls, both the qualified name and the bare one, sharing a
single
TypeInfo— so each dict addition also produced an equivalence keyed by anunqualified ATF tycon (first seen:
Repof Prelude'sGeneric, during the Prelude'sown compile).
Build the ATF tycon from
ti_qual_idand keep one entry per ATF by matching only thecanonical alias.
Why
Every other ITCon producer feeds from CTypes canonicalized by
MakeSymTab.trCType',which substitutes the qualified
ti_qual_id; this was the one site synthesizing tyconsoutside that layer. A bare-named equivalence key is latently unsound —
qualEqlets anunqualified id match any package's same-named ATF — and it breaks the
one-tycon-per-qualified-name invariant that the IType interning stack (#1048) turns into
a hard assertion. With the origin fixed, #1048 retires its tolerance paths for
unqualified tycons.
Validation
Found by the interning stack's checked build (
-trace-itype-intern, since removed);that checked library build is green with this fix, and the full stack records
fullparallel 20281 passes / 0 unexpected failures / 134 expected failures. Standalone on
main the change is output-neutral: the equivalence set merely loses its
duplicate/unqualified keys.
Stack
Standalone on main. First of four independent fixes (#1051 (this), #1052 listcons SDataCon
sort, #1053 (S0015 field position), #1054 (CIclass sort members)) that the reworked #1048
(IType interning) stacks on, below #1045 ← #1046 ← #1047.