Skip to content

Sema: Check the availability of conformance type witnesses #75938

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

tshortli
Copy link
Contributor

@tshortli tshortli commented Aug 17, 2024

The type satisfying a protocol requirement must be at least as available as the associated type for the requirement. This has always been a potential soundness hole that should have been checked, but it is especially important to diagnose these issues now that associated type requirements can have their own availability (#70735). Unfortunately, these diagnostics cannot be introduced as errors since doing so would break source compatibility for existing libraries so for now they are staged as warnings until a post Swift 6 language mode is available.

Resolves rdar://134093006.

@tshortli
Copy link
Contributor Author

@swift-ci please test

@tshortli
Copy link
Contributor Author

@swift-ci please test source compatibility

@tshortli tshortli force-pushed the associated-type-witness-availability branch from 2824391 to 189c1d3 Compare August 22, 2024 00:07
@tshortli
Copy link
Contributor Author

@swift-ci please smoke test

@tshortli tshortli marked this pull request as ready for review August 22, 2024 00:13
@tshortli tshortli requested a review from DougGregor August 22, 2024 00:13
@tshortli tshortli marked this pull request as draft August 22, 2024 17:00
Code that wants to determine whether a given declaration should be considered
unavailable should use this new utility, which will take the unavailability of
the context of use into consideration.

NFC.
The type satisfying a protocol requirement must be at least as available as the
associated type for the requirement.

Resolves rdar://134093006
@tshortli tshortli force-pushed the associated-type-witness-availability branch from d002bb8 to 4420ea8 Compare August 22, 2024 22:26
@tshortli
Copy link
Contributor Author

@swift-ci please smoke test

@tshortli tshortli marked this pull request as ready for review August 22, 2024 22:26
@tshortli tshortli merged commit 30b6cca into swiftlang:main Aug 23, 2024
3 checks passed
@tshortli tshortli deleted the associated-type-witness-availability branch August 23, 2024 03:14
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