Skip to content

AST: Introduce DeclRuntimeAvailability #80051

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 Mar 17, 2025

DeclRuntimeAvailabilityRequest is a replacement for SemanticDeclAvailabilityRequest and satisfies a narrower query that only determines whether a decl is reachable by execution at runtime (rather than whether it is also considered available at compile time). DeclRuntimeAvailabilityRequest leverages the availability constraint machinery to determine whether a decl is available at runtime, rather than re-implementing it.

It can be replaced by querying the `AvailabilityContext` for a declaration
directly.
Extract the tests that verify back deployment of the standard library function
`diagnoseUnavailableCodeReached()` into a separate, multi-platform test.
@tshortli tshortli force-pushed the refactor-semantic-decl-availability-request branch from 9b64a34 to 24eb380 Compare March 17, 2025 06:34
Generalize the implementation of `SemanticDeclAvailabilityRequest` in
preparation for adding a new case to `SemanticDeclAvailability`. Use the
centralized availability constraint query instead of implementing a bespoke
algorithm for gathering constraints. Simplify `SemanticDeclAvailability` by
removing a case that is no longer relevant.

Part of rdar://138441307.
@tshortli tshortli force-pushed the refactor-semantic-decl-availability-request branch from 24eb380 to 7ed2a0d Compare March 17, 2025 16:33
@tshortli
Copy link
Contributor Author

@swift-ci please smoke test

@tshortli tshortli merged commit dd68e98 into swiftlang:main Mar 17, 2025
3 checks passed
@tshortli tshortli deleted the refactor-semantic-decl-availability-request branch March 17, 2025 22:04
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