-
Notifications
You must be signed in to change notification settings - Fork 10.5k
Sema: Warn about non-final classes conforming to protocols with a same-type requirement on 'Self' #41545
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
Sema: Warn about non-final classes conforming to protocols with a same-type requirement on 'Self' #41545
Conversation
…e-type requirement on 'Self' This is unsound because it breaks covariance of protocol conformances on classes. See the test case and changelog entry for details.
e02ad86
to
c98ddb9
Compare
@swift-ci Please smoke test |
@swift-ci Please test source compatibility |
Nice! I guess this also catches SR-10713? Edit: Ah looks like that's more or less |
@swift-ci Please test source compatibility |
@swift-ci Please smoke test |
1 similar comment
@swift-ci Please smoke test |
@swift-ci Please test source compatibility |
@swift-ci Please smoke test Linux |
1 similar comment
@swift-ci Please smoke test Linux |
@swift-ci Please smoke test macOS |
@hamishknight Ah indeed, looks like you discovered the issue 3 years ago :) |
@hamishknight Also I found another related radar I filed last year: rdar://74944514. My commit here doesn't actually catch that case, but it will after a small change. I'll generalize it in a follow-up PR. |
This is unsound because it breaks covariance of protocol conformances
on classes. See the test case and changelog entry for details.