swift
1e21d8df - [GSB] Eliminate self-derived nested-type-name-match constraints..

Commit
8 years ago
[GSB] Eliminate self-derived nested-type-name-match constraints.. Nested-type-name-match constraints are odd because they are effectively artifacts of the GenericSignatureBuilder's algorithm, i.e., they occur when we have two PotentialArchetypes representing the same type, and each of those PA's has a nested type based on the same associated type. Because of this, nested-type-name-match constraints have no useful requirement sources, so the normal means of detecting self-derived constraints doesn't suffice, and we end up with self-derived nested-type-name-match constraints eliminating the constraints they depend on, causing spurious "redundant same-type constraint" diagnostics and minimized generic signatures that drop important requirements. Handle nested-type-name-match constraints by first keeping them out of the connected-components algorithm used to compute same-type constraints within an equivalence class. Then, detect self-derived nested-type-name-match constraints by determining whether any of the ancestor potential archetypes are in the same equivalence class... and redundant with the edge that makes the ancestor potential archetypes equivalent. Remove such self-derived edges, and treat all other nested-type-name-match edges as derived, providing a minimized signature. Fixes SR-5841, SR-5601, and SR-5610
Author
Committer
Parents
Loading