-
Notifications
You must be signed in to change notification settings - Fork 10.5k
[Diagnostics] Transfer previously resolved types directly from expressions #17947
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
…sions While trying to diagnose the problem with previously type-checked sub-expression, use its type-checked variant as a source of type information, instead of transferring from its original constraint system, because if expression was type-checked successfully it would have all of the required information in AST, and that doesn't rely on associated constraint system being present. Resolves: rdar://problem/42056741
@swift-ci please test |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM. That code was required at one point but I suspect we're caching more types in enough places that it's now more of a problem than a solution.
You can remove the tranferExprTypes() method at this point, too.
@swift-ci please test source compatibility |
Removing |
@swift-ci please test |
@swift-ci please test source compatibility |
Can you add the type checker test case as well? IIRC it didn’t crash on master but still emitted a duplicate diagnostic. |
The example I've added doesn't crash without code-completion because that triggers diagnostics differently, I couldn't make it crash without using code completion, and it also doesn't produce duplicate diagnostics either, you might be thinking of a different example... |
Build failed |
3 LLDB tests are failing again:
|
@swift-ci please test Linux platform |
@swift-ci please test |
@swift-ci please test source compatibility |
Build failed |
@swift-ci please test macOS platform |
While trying to diagnose the problem with previously type-checked
sub-expression, use its type-checked variant as a source of type
information, instead of transferring from its original constraint system,
because if expression was type-checked successfully it would
have all of the required information in AST, and that doesn't
rely on associated constraint system being present.
Resolves: rdar://problem/42056741