-
Notifications
You must be signed in to change notification settings - Fork 10.5k
[ConstraintSystem] Use missing conformance
fix to diagnose contextual failures
#24754
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
[ConstraintSystem] Use missing conformance
fix to diagnose contextual failures
#24754
Conversation
@slavapestov This is still a draft, I'm trying to work out couple of problems related to conditional requirements and add some more tests. |
… protocol type Switch type allows "missing conformance" diagnostic to be used not only for protocols by for protocol compositions as well.
…al failures Extend use of `missing protocol conformance` fix to cover contextual failures, such as: - Assignment mismatches, where destination requires source to conform to certain protocol (or protocol composition); - Incorrect returns where returned type doesn't conform to the protocol specified in the signature.
…chExistentialTypes`
6cc11db
to
d5c561b
Compare
@slavapestov I have moved fix to |
@swift-ci please test |
Build failed |
Build failed |
contextualType->is<ProtocolCompositionType>()) | ||
diagID = diagIDProtocol; | ||
|
||
if (contextualType->isExistentialType()) { |
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.
Should we do the same for opaque result types and/or AnyHashable? They have the same kinds of conformance-related issues.
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.
Yeah, those would already be diagnosed by new diagnostic framework, I have a couple of examples added to the suite in my previous PR :)
This broke one test on my Linux machine (Red Hat Fedora 30). Was this expected?
|
Yeah, I should have re-ran the tests... |
Extend use of
missing protocol conformance
fix to cover contextualfailures, such as:
to certain protocol (or protocol composition);
protocol specified in the signature.