Skip to content

Commit ed8d435

Browse files
authored
Merge pull request #29816 from rintaro/ide-completion-rdar59344203
[CodeCompletion] Fix a crash in context type analysis
2 parents 1fc4db5 + 9cb2c05 commit ed8d435

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

lib/IDE/ExprContextAnalysis.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -647,7 +647,8 @@ class ExprContextAnalyzer {
647647
}
648648
case ExprKind::If: {
649649
auto *IE = cast<IfExpr>(Parent);
650-
if (SM.rangeContains(IE->getCondExpr()->getSourceRange(),
650+
if (IE->isFolded() &&
651+
SM.rangeContains(IE->getCondExpr()->getSourceRange(),
651652
ParsedExpr->getSourceRange())) {
652653
recordPossibleType(Context.getBoolDecl()->getDeclaredInterfaceType());
653654
break;

0 commit comments

Comments
 (0)