Skip to content

Sema: Check custom domain availability during conformance checking #83349

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

tshortli
Copy link
Contributor

Protocol requirement witnesses cannot only be available in a custom availability domain if the requirement does not have the same availability constraint.

Resolves rdar://156462516.

tshortli added 3 commits July 25, 2025 21:30
For declarations that aren't in source files there isn't an `AvailabilityScope`
tree to consult to find their `AvailabilityContext`. The fallback mechanism
used by `AvailabilityContext::forLocation()` walks up the `DeclContext`
hierarchy to build up the context for implicit code but this isn't entirely
correct since it skips over certain kinds of decls (like property
declarations). Instead, we need to walk up the parent decl hierarchy that is
used for availability inference to ensure that no decls with relevant
availability attributes are skipped.
Protocol requirement witnesses cannot only be available in a custom
availability domain if the requirement does not have the same availability
constraint.

Resolves rdar://156462516.
@tshortli tshortli force-pushed the check-custom-domain-availability-for-conformances branch from 76947b0 to 0fabfa3 Compare July 26, 2025 04:32
@tshortli
Copy link
Contributor Author

@swift-ci please test

@tshortli tshortli merged commit c4e242e into swiftlang:main Jul 26, 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.

1 participant