Skip to content

Commit da5f716

Browse files
committed
NCGenerics: fix @UIApplicationMain
1 parent 08b71e0 commit da5f716

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

lib/SILGen/SILGenFunction.cpp

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1192,6 +1192,10 @@ void SILGenFunction::emitArtificialTopLevel(Decl *mainDecl) {
11921192
CanType anyObjectMetaTy = CanExistentialMetatypeType::get(anyObjectTy,
11931193
MetatypeRepresentation::ObjC);
11941194

1195+
auto conformances =
1196+
SGM.SwiftModule->collectExistentialConformances(mainClassMetaty,
1197+
anyObjectMetaTy);
1198+
11951199
auto paramConvention = ParameterConvention::Direct_Unowned;
11961200
auto params = {SILParameterInfo(anyObjectMetaTy, paramConvention)};
11971201
std::array<SILResultInfo, 1> resultInfos = {
@@ -1218,7 +1222,7 @@ void SILGenFunction::emitArtificialTopLevel(Decl *mainDecl) {
12181222
SILType::getPrimitiveObjectType(mainClassMetaty));
12191223
metaTy = B.createInitExistentialMetatype(mainClass, metaTy,
12201224
SILType::getPrimitiveObjectType(anyObjectMetaTy),
1221-
{});
1225+
conformances);
12221226
SILValue optNameValue = B.createApply(
12231227
mainClass, NSStringFromClass, {}, metaTy);
12241228
ManagedValue optName = emitManagedRValueWithCleanup(optNameValue);

0 commit comments

Comments
 (0)