Skip to content

Fixes for unavailable superclass conformances #59131

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
merged 3 commits into from
May 28, 2022

Conversation

DougGregor
Copy link
Member

@DougGregor DougGregor commented May 27, 2022

Introduce two related fixes to avoid using the unavailable conformance of a superclass as if it should be inherited by the subclasses. This is incorrect, because subclasses could define their own conformance to the same protocol. The two places are:

  • Requirement machine: don't canonicalize away conformance requirements based on an unavailable conformance of a superclass requirement
  • Conformance lookup table: don't inherit unavailable conformances

Fixes rdar://91853658 and rdar://89992569

…onstraints.

When determining whether a superclass conforms to a particular protocol,
skip unavailable conformances. This way, we don't minimize away a
constraint that might only apply to subclasses of the specified
superclass.

Fixes rdar://91853658.
When a class has an unavailable conformance to a protocol, do not
inherit that unavailable conformance, because it can get in the way of
subclasses defining their own (properly-available) conformance.

Fixes rdar://89992569.
@DougGregor
Copy link
Member Author

@swift-ci please smoke test

@DougGregor
Copy link
Member Author

@swift-ci please smoke test

@DougGregor DougGregor merged commit c076f4d into swiftlang:main May 28, 2022
@DougGregor DougGregor deleted the sendable-conformance-superclass branch May 28, 2022 02:05
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.

1 participant