Skip to content

[6.2] AST: Tweak ConformanceLookupTable::compareConformances() some more #82447

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

Merged

Conversation

slavapestov
Copy link
Contributor

@slavapestov slavapestov commented Jun 24, 2025

6.2 cherry-pick of #82446

  • Description: If two conformances imply a conformance to the same marker protocol, don't diagnose redundancy if they differ by unavailability. Instead, allow the more available conformance to win.

  • Scope of the issue: This allows declaring a type that conforms to a protocol that inherits from SendableMetatype, followed by an unavailable Sendable conformance on the same type.

  • Risk: Low. Might break availability checking in some edge case, perhaps.

  • Radar: rdar://152509409.

  • Reviewed by: @AnthonyLatsis

If two conformances imply a conformance to the same marker
protocol, don't diagnose redundancy if they differ by
unavailability. Instead, allow the more available conformance
to win.

This allows declaring a type that conforms to a protocol
that inherits from SendableMetatype, followed by an
unavailable Sendable conformance on the same type.

Fixes rdar://152509409.
@slavapestov slavapestov requested a review from a team as a code owner June 24, 2025 02:58
@slavapestov
Copy link
Contributor Author

@swift-ci Please test

@slavapestov slavapestov merged commit e78d734 into swiftlang:release/6.2 Jun 25, 2025
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants