mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
When enumerating requirements, always use the archetype anchors to express requirements. Unlike "representatives", which are simply there to maintain the union-find data structure used to track equivalence classes of potential archetypes, archetype anchors are the ABI-stable canonical types within a fully-formed generic signature. The test case churn comes from two places. First, while representatives are *often* the same as the archetype anchors, they aren't *always* the same. Where they differ, we'll see a change in both the printed generic signature and, therefore, it's mangling. Additionally, requirement inference now takes much greater care to make sure that the first types in the requirement follow archetype anchor ordering, so actual conformance requirements occur in the requirement list at the archetype anchor---not at the first type that is equivalent to the anchor---which permits the simplification in IRGen's emission of polymorphic arguments.