-
Notifications
You must be signed in to change notification settings - Fork 10.5k
[CodeCompletion] Allow preChecking an expression twice in code completion #38474
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
@swift-ci Please smoke test |
@xedin Should |
I think it should be yes, although there might be edge cases which cases these crashes... |
Is this some kind of a stale pointer problem where sequence has been folded but something still holds a reference to an original version? |
@xedin Yeah, some expression kinds e.g. |
Maybe we can just disable these assertions ( |
I think it would be okay. Real solution here would be to type-check multi-statement closures together with their context just like single-expression ones, once that's done we should be able to remove all this complicated fallback logic. |
…tion In code completion we might call `preCheckExpression` twice - once for the first pass and once for the second pass. This is fine since `preCheckExpression` idempotent, so don't assert if we are in code completion mode. Fixes rdar://79136653 [SR-14755]
a8ae0a6
to
202905f
Compare
OK, that’s the even simpler fix. I disabled the asserts if |
@swift-ci Please smoke test |
In code completion we might call
preCheckExpression
twice - once for the first pass and once for the second pass. This is fine sincepreCheckExpression
idempotent, so don't assert if we are in code completion mode.Fixes rdar://79136653 [SR-14755]