-
Notifications
You must be signed in to change notification settings - Fork 10.5k
[CSDiagnostics] Offer protocol conformance fix-it in ContextualFailure #27026
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
This is my initial implementation, but let me know your thoughts :) |
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.
It's nice to see this get picked up so quickly!
This isn't a full review, just had a couple of comments.
Also, what do you think about offering to add requirement stubs when in editor mode? As is, applying this fix-it will usually result in the 'missing requirements' error and the fix-it to add stubs.
…sing protocols during contextual failure
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.
I think this is a great idea!
@swift-ci please smoke test |
If we're assigning a value of concrete type to a protocol type but the type does not conform to the protocol and it's the same as the decl context's type, then offer a fix-it to add the conformance.
For example:
Resolves SR-11412.