Skip to content

Commit eeb0a1f

Browse files
committed
Fix issues after rebase.
Had to rebase due to revert of syxtax parsing #27675.
1 parent e93d498 commit eeb0a1f

File tree

2 files changed

+4
-6
lines changed

2 files changed

+4
-6
lines changed

lib/Parse/ParsePattern.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -787,9 +787,9 @@ Parser::parseFunctionSignature(Identifier SimpleName,
787787
diagnose(throwsLoc, diag::throw_in_function_type)
788788
.fixItReplace(throwsLoc, "throws");
789789
} else if (Tok.is(tok::kw_try)) {
790-
diagnose(Tok.getLoc(), diag::throw_in_function_type)
791-
.fixItReplace(Tok.getLoc(), "throws");
792-
ignoreToken();
790+
SourceLoc tryLoc = consumeToken();
791+
diagnose(tryLoc, diag::throw_in_function_type)
792+
.fixItReplace(tryLoc, "throws");
793793
}
794794

795795
SourceLoc arrowLoc;

lib/Parse/ParseType.cpp

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -409,9 +409,7 @@ ParserResult<TypeRepr> Parser::parseType(Diag<> MessageID,
409409
diagnose(Tok.getLoc(), DiagID)
410410
.fixItReplace(Tok.getLoc(), "throws");
411411
}
412-
if (Tok.isNot(tok::try)) {
413-
throwsLoc = consumeToken();
414-
}
412+
throwsLoc = consumeToken();
415413
}
416414

417415
if (Tok.is(tok::arrow)) {

0 commit comments

Comments
 (0)