File tree Expand file tree Collapse file tree 1 file changed +6
-2
lines changed
lib/SILOptimizer/FunctionSignatureTransforms Expand file tree Collapse file tree 1 file changed +6
-2
lines changed Original file line number Diff line number Diff line change @@ -95,12 +95,16 @@ bool ExistentialSpecializer::findConcreteTypeFromSoleConformingType(
95
95
auto ArgType = Arg->getType ();
96
96
auto SwiftArgType = ArgType.getASTType ();
97
97
98
+ CanType constraint = SwiftArgType;
99
+ if (auto existential = constraint->getAs <ExistentialType>())
100
+ constraint = existential->getConstraintType ()->getCanonicalType ();
101
+
98
102
// / Do not handle composition types yet.
99
- if (isa<ProtocolCompositionType>(SwiftArgType ))
103
+ if (isa<ProtocolCompositionType>(constraint ))
100
104
return false ;
101
105
assert (ArgType.isExistentialType ());
102
106
// / Find the protocol decl.
103
- auto *PD = dyn_cast<ProtocolDecl>(SwiftArgType ->getAnyNominal ());
107
+ auto *PD = dyn_cast<ProtocolDecl>(constraint ->getAnyNominal ());
104
108
if (!PD)
105
109
return false ;
106
110
You can’t perform that action at this time.
0 commit comments