File tree Expand file tree Collapse file tree 1 file changed +20
-2
lines changed Expand file tree Collapse file tree 1 file changed +20
-2
lines changed Original file line number Diff line number Diff line change @@ -1883,7 +1883,16 @@ namespace {
18831883
18841884 MetadataResponse visitProtocolType (CanProtocolType type,
18851885 DynamicMetadataRequest request) {
1886- llvm_unreachable (" constraint type should be wrapped in existential type" );
1886+ assert (false && " constraint type should be wrapped in existential type" );
1887+
1888+ CanExistentialType existential (
1889+ ExistentialType::get (type)->castTo <ExistentialType>());
1890+
1891+ if (auto metatype = tryGetLocal (existential, request))
1892+ return metatype;
1893+
1894+ auto metadata = emitExistentialTypeMetadata (existential);
1895+ return setLocal (type, MetadataResponse::forComplete (metadata));
18871896 }
18881897
18891898 MetadataResponse
@@ -1892,7 +1901,16 @@ namespace {
18921901 if (type->isAny () || type->isAnyObject ())
18931902 return emitSingletonExistentialTypeMetadata (type);
18941903
1895- llvm_unreachable (" constraint type should be wrapped in existential type" );
1904+ assert (false && " constraint type should be wrapped in existential type" );
1905+
1906+ CanExistentialType existential (
1907+ ExistentialType::get (type)->castTo <ExistentialType>());
1908+
1909+ if (auto metatype = tryGetLocal (existential, request))
1910+ return metatype;
1911+
1912+ auto metadata = emitExistentialTypeMetadata (existential);
1913+ return setLocal (type, MetadataResponse::forComplete (metadata));
18961914 }
18971915
18981916 MetadataResponse
You can’t perform that action at this time.
0 commit comments