File tree Expand file tree Collapse file tree 1 file changed +9
-1
lines changed Expand file tree Collapse file tree 1 file changed +9
-1
lines changed Original file line number Diff line number Diff line change @@ -280,8 +280,16 @@ usesExtendedExistentialMetadata(CanExistentialMetatypeType type) {
280280
281281 // The only existential types that don't currently use ExistentialType
282282 // are Any and AnyObject, which don't use extended metadata.
283- if (usesExtendedExistentialMetadata (cur))
283+ if (usesExtendedExistentialMetadata (cur)) {
284+ // HACK: The AST for an existential metatype of a (parameterized) protocol
285+ // still directly wraps the existential type as its instance, which means
286+ // we need to reconstitute the enclosing ExistentialType.
287+ assert (cur->isExistentialType ());
288+ if (!cur->is <ExistentialType>()) {
289+ cur = ExistentialType::get (cur)->getCanonicalType ();
290+ }
284291 return std::make_pair (cast<ExistentialType>(cur), depth);
292+ }
285293 return None;
286294}
287295
You can’t perform that action at this time.
0 commit comments