]> Repositorios git - classgraph.git/commit
Skip data fam-instances in reduceTypeArg to avoid infinite recursion
authorJavier Sagredo <[email protected]>
Thu, 7 May 2026 00:01:33 +0000 (02:01 +0200)
committerJavier Sagredo <[email protected]>
Thu, 7 May 2026 00:01:33 +0000 (02:01 +0200)
commit5a09863f9c50bb6234a8e5b3bf8c9805b21579de
treedcf25247d6e6f309eb035f2acaa1167f4ee67d89
parent65decd3a2d6477a419d4f853e1192f1c77238682
Skip data fam-instances in reduceTypeArg to avoid infinite recursion

The data-family R: rewrite makes a data fam-instance's fiRhs
structurally equal to its FamilyApp LHS (e.g. for `data instance
Crate Int`, fiRhs is `FamilyApp Crate [Int]`). reduceTypeArg used
to unify the use site against fiArgs and recurse on
applySubst(fiRhs, subst) — which produced the same FamilyApp shape
again and looped forever for any constraint mentioning a data
fam-instance.

Skip data fam-instances in reduceTypeArg entirely. Their RHS is
opaque (the synthetic R: TyCon pre-rewrite, the circular FamilyApp
post-rewrite); reducing through them never makes progress, only
ever loops. The use-site FamilyApp falls through unchanged, which
addFamilyLinksFromArgs / the predicate-node + chain machinery then
handle as the data-family use site they actually are.

Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
data/viewer.js