Skip to content

Commit 71d8a9c

Browse files
committed
Unset the return location for an implicit return nil
The `return` keyword here doesn't have a source location, so unset it. This matches the other implicit single expression returns.
1 parent 246f09a commit 71d8a9c

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

lib/Parse/ParseDecl.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8732,7 +8732,7 @@ Parser::parseAbstractFunctionBodyImpl(AbstractFunctionDecl *AFD) {
87328732
if (F->isFailable() && isa<NilLiteralExpr>(E)) {
87338733
// If it's a nil literal, just insert return. This is the only
87348734
// legal thing to return.
8735-
auto RS = ReturnStmt::createImplicit(Context, E->getStartLoc(), E);
8735+
auto RS = ReturnStmt::createImplicit(Context, E);
87368736
BS->setLastElement(RS);
87378737
AFD->setHasSingleExpressionBody();
87388738
AFD->setSingleExpressionBody(E);

0 commit comments

Comments
 (0)