Skip to content

Commit 927c709

Browse files
author
Nathan Hawes
authored
Merge pull request swiftlang#36738 from nathawes/fix-completion-crash
[CodeCompletion][Parse] Don't drop the contained expression when completing within an InOutExpr
2 parents e6b7e5e + b8f5bf3 commit 927c709

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

lib/Parse/ParseExpr.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -533,7 +533,7 @@ ParserResult<Expr> Parser::parseExprUnary(Diag<> Message, bool isExprBasic) {
533533

534534
ParserResult<Expr> SubExpr = parseExprUnary(Message, isExprBasic);
535535
if (SubExpr.hasCodeCompletion())
536-
return makeParserCodeCompletionResult<Expr>();
536+
return makeParserCodeCompletionResult<Expr>(SubExpr.getPtrOrNull());
537537
if (SubExpr.isNull())
538538
return nullptr;
539539
return makeParserResult(
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
// RUN: %swift-ide-test -code-completion -code-completion-token=COMPLETE -source-filename %s
2+
3+
if undefined(&self.#^COMPLETE^#

0 commit comments

Comments
 (0)