Skip to content

Commit 8788317

Browse files
authored
Merge pull request swiftlang#33038 from rintaro/ide-completion-funcreturntype
[CodeCompletion] Don't throw away parsed return type for function decls
2 parents b96e34c + bf379f2 commit 8788317

File tree

1 file changed

+2
-5
lines changed

1 file changed

+2
-5
lines changed

lib/Parse/ParsePattern.cpp

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -839,13 +839,10 @@ Parser::parseFunctionSignature(Identifier SimpleName,
839839

840840
ParserResult<TypeRepr> ResultType =
841841
parseDeclResultType(diag::expected_type_function_result);
842-
if (ResultType.hasCodeCompletion())
843-
return ResultType;
844842
retType = ResultType.getPtrOrNull();
845-
if (!retType) {
846-
Status.setIsParseError();
843+
Status |= ResultType;
844+
if (Status.isError())
847845
return Status;
848-
}
849846
} else {
850847
// Otherwise, we leave retType null.
851848
retType = nullptr;

0 commit comments

Comments
 (0)