Skip to content

Commit 1ac9acb

Browse files
committed
Sema: We don't have to explicitly set the type of the main function
1 parent 1802ec9 commit 1ac9acb

File tree

1 file changed

+0
-5
lines changed

1 file changed

+0
-5
lines changed

lib/Sema/TypeCheckAttr.cpp

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1871,10 +1871,6 @@ void AttributeChecker::visitMainTypeAttr(MainTypeAttr *attr) {
18711871

18721872
bool mainFunctionThrows = mainFunction->hasThrows();
18731873

1874-
auto voidToVoidFunctionType =
1875-
FunctionType::get({}, context.TheEmptyTupleType,
1876-
FunctionType::ExtInfo().withThrows(mainFunctionThrows));
1877-
auto nominalToVoidToVoidFunctionType = FunctionType::get({AnyFunctionType::Param(nominal->getInterfaceType())}, voidToVoidFunctionType);
18781874
auto *func = FuncDecl::create(
18791875
context, /*StaticLoc*/ SourceLoc(), StaticSpellingKind::KeywordStatic,
18801876
/*FuncLoc*/ SourceLoc(),
@@ -1930,7 +1926,6 @@ void AttributeChecker::visitMainTypeAttr(MainTypeAttr *attr) {
19301926
auto *body = BraceStmt::create(context, SourceLoc(), stmts,
19311927
SourceLoc(), /*Implicit*/true);
19321928
func->setBodyParsed(body);
1933-
func->setInterfaceType(nominalToVoidToVoidFunctionType);
19341929

19351930
iterableDeclContext->addMember(func);
19361931

0 commit comments

Comments
 (0)