Skip to content

Commit eabdc04

Browse files
committed
Now that the AST printer is properly forming all function types, we don't need
a hack for the sil parser.
1 parent 6619e12 commit eabdc04

File tree

1 file changed

+4
-12
lines changed

1 file changed

+4
-12
lines changed

lib/Sema/TypeCheckType.cpp

Lines changed: 4 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1949,19 +1949,11 @@ Type TypeResolver::resolveASTFunctionType(FunctionTypeRepr *repr,
19491949
if (!isa<TupleTypeRepr>(repr->getArgsTypeRepr()) &&
19501950
!repr->isWarnedAbout()) {
19511951
auto args = repr->getArgsTypeRepr();
1952-
1953-
bool isInSILMode = false;
1954-
if (auto sourceFile = DC->getParentSourceFile())
1955-
isInSILMode = sourceFile->Kind == SourceFileKind::SIL;
1956-
1957-
// The SIL printer is still printing function types with no parens in some
1958-
// cases. Don't warn for now.
1959-
if (!isInSILMode) {
1960-
TC.diagnose(args->getStartLoc(), diag::function_type_no_parens)
1961-
.highlight(args->getSourceRange())
1962-
.fixItInsert(args->getStartLoc(), "(")
1952+
TC.diagnose(args->getStartLoc(), diag::function_type_no_parens)
1953+
.highlight(args->getSourceRange())
1954+
.fixItInsert(args->getStartLoc(), "(")
19631955
.fixItInsertAfter(args->getEndLoc(), ")");
1964-
}
1956+
19651957
// Don't emit this warning three times when in generics.
19661958
repr->setWarned();
19671959
}

0 commit comments

Comments
 (0)