@@ -1613,19 +1613,17 @@ void ASTMangler::appendType(Type type, GenericSignature sig,
1613
1613
// ExtendedExistentialTypeShapes consider existential metatypes to
1614
1614
// be part of the existential, so if we're symbolically referencing
1615
1615
// shapes, we need to handle that at this level.
1616
- if (EMT->getExistentialLayout ().needsExtendedShape ()) {
1616
+ if (EMT->getExistentialLayout ().needsExtendedShape (AllowInverses )) {
1617
1617
auto referent = SymbolicReferent::forExtendedExistentialTypeShape (EMT);
1618
1618
if (canSymbolicReference (referent)) {
1619
1619
appendSymbolicExtendedExistentialType (referent, EMT, sig, forDecl);
1620
1620
return ;
1621
1621
}
1622
- }
1623
1622
1624
- if (EMT->getInstanceType ()->isExistentialType () &&
1625
- EMT->hasParameterizedExistential ())
1626
1623
appendConstrainedExistential (EMT->getInstanceType (), sig, forDecl);
1627
- else
1624
+ } else {
1628
1625
appendType (EMT->getInstanceType (), sig, forDecl);
1626
+ }
1629
1627
1630
1628
if (EMT->hasRepresentation ()) {
1631
1629
appendOperator (" Xm" ,
@@ -1678,8 +1676,7 @@ void ASTMangler::appendType(Type type, GenericSignature sig,
1678
1676
return appendType (strippedTy, sig, forDecl);
1679
1677
}
1680
1678
1681
- if (PCT->hasParameterizedExistential ()
1682
- || (PCT->hasInverse () && AllowInverses))
1679
+ if (PCT->getExistentialLayout ().needsExtendedShape (AllowInverses))
1683
1680
return appendConstrainedExistential (PCT, sig, forDecl);
1684
1681
1685
1682
// We mangle ProtocolType and ProtocolCompositionType using the
@@ -1693,7 +1690,8 @@ void ASTMangler::appendType(Type type, GenericSignature sig,
1693
1690
1694
1691
case TypeKind::Existential: {
1695
1692
auto *ET = cast<ExistentialType>(tybase);
1696
- if (ET->getExistentialLayout ().needsExtendedShape ()) {
1693
+
1694
+ if (ET->getExistentialLayout ().needsExtendedShape (AllowInverses)) {
1697
1695
auto referent = SymbolicReferent::forExtendedExistentialTypeShape (ET);
1698
1696
if (canSymbolicReference (referent)) {
1699
1697
appendSymbolicExtendedExistentialType (referent, ET, sig, forDecl);
@@ -1703,6 +1701,7 @@ void ASTMangler::appendType(Type type, GenericSignature sig,
1703
1701
return appendConstrainedExistential (ET->getConstraintType (), sig,
1704
1702
forDecl);
1705
1703
}
1704
+
1706
1705
return appendType (ET->getConstraintType (), sig, forDecl);
1707
1706
}
1708
1707
0 commit comments