Direct alias cycles (typealias A = A, A = B; B = A) are correctly caught (E019).
But when an alias references itself through an anonymous type, slicec/src/patchers/type_ref_patcher.rs:258 returns early on the Patched anonymous type without looking inside it, so a cyclic type graph forms (a Sequence whose element resolves back to itself).
The struct/enum cycle detector's guard is keyed on struct/enum identifiers, and this loop contains none, so it never trips — the recursive traversals then loop forever:
Reproduction
module T
typealias A = Sequence<A>
(Dictionary<int32, A> etc. too.) Exit 127.
Fix
In the alias cycle detector, recurse through anonymous Sequence/Dictionary/Result underlying types, tracking visited aliases, and report the cycle instead of looping.
Direct alias cycles (
typealias A = A, A = B; B = A) are correctly caught (E019).But when an alias references itself through an anonymous type,
slicec/src/patchers/type_ref_patcher.rs:258returns early on thePatchedanonymous type without looking inside it, so a cyclic type graph forms (aSequencewhose element resolves back to itself).The struct/enum cycle detector's guard is keyed on struct/enum identifiers, and this loop contains none, so it never trips — the recursive traversals then loop forever:
Reproduction
(Dictionary<int32, A> etc. too.) Exit 127.
Fix
In the alias cycle detector, recurse through anonymous Sequence/Dictionary/Result underlying types, tracking visited aliases, and report the cycle instead of looping.