File tree Expand file tree Collapse file tree 1 file changed +9
-7
lines changed Expand file tree Collapse file tree 1 file changed +9
-7
lines changed Original file line number Diff line number Diff line change @@ -114,19 +114,21 @@ ProtocolConformanceRef::subst(Type origType,
114
114
115
115
auto *proto = getRequirement ();
116
116
117
+ // If the type is an existential, it must be self-conforming.
118
+ if (substType->isExistentialType ()) {
119
+ auto optConformance =
120
+ proto->getModuleContext ()->lookupExistentialConformance (substType, proto);
121
+ assert (optConformance && " existential type didn't self-conform" );
122
+ return *optConformance;
123
+ }
124
+
117
125
// Check the conformance map.
118
126
if (auto result = conformances (origType->getCanonicalType (),
119
127
substType, proto)) {
120
128
return *result;
121
129
}
122
130
123
- // The only remaining case is that the type is an existential that
124
- // self-conforms.
125
- assert (substType->isExistentialType ());
126
- auto optConformance =
127
- proto->getModuleContext ()->lookupExistentialConformance (substType, proto);
128
- assert (optConformance && " existential type didn't self-conform" );
129
- return *optConformance;
131
+ llvm_unreachable (" Invalid conformance substitution" );
130
132
}
131
133
132
134
Type
You can’t perform that action at this time.
0 commit comments