Skip to content

Commit b91bd28

Browse files
committed
[GSB] Use precise potential-archetype identity when forming protocol-requirement sources.
When we’re determining what type should be used to key a ProtocolRequirement based on the source’s potential archetype and the target’s potential archetype, use potential archetype identity (==) rather than equivalence-class membership to cover the basis case. This ensures that interesting identity relationships in the enclosing context (e.g., the current GenericSignatureBuilder) don’t cause us to compute incorrect stored types.
1 parent eba4aff commit b91bd28

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

lib/AST/GenericSignatureBuilder.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -803,7 +803,7 @@ static Type formProtocolRelativeType(ProtocolDecl *proto,
803803
PotentialArchetype *basePA,
804804
PotentialArchetype *pa) {
805805
// Basis case: we've hit the base potential archetype.
806-
if (basePA->isInSameEquivalenceClassAs(pa))
806+
if (basePA == pa)
807807
return proto->getSelfInterfaceType();
808808

809809
// Recursive case: form a dependent member type.

0 commit comments

Comments
 (0)