Commit 9041861
Nathan Hawes
[CodeCompletion] Reuse CompletionContextFinder for fallback completion when no typeCheckExpression call is made
...and adjust the fallback context it choses now that ErrorExprs no longer
cause constraint generation to fail.
Also fix some issues with the fallback logic in typeCheckForCodeCompletion:
1) For completion expressions in multi-statement closures, we were assuming a
separate typeCheckExpression call would be made when the outer expression
produced a single solution that had a resolved type for the closure. If the
solution contained other fixes unrelated to the closure however, it wasn't
applied and a separate call for the body was never made.
2) typeCheckForCodeComplation sometimes falls back to regular expression type
checking but didn't update the passed-in target's expression after santizing
and prechecking it, which may have modified it and its sub-expressions. This
triggered assertion failures in certain cases due to the mix of the stale
top-level expression pointer being used with updated subexpressions.1 parent 1696f4d commit 9041861
File tree
2 files changed
+222
-166
lines changed- lib/Sema
- test/IDE
2 files changed
+222
-166
lines changed
0 commit comments