Skip to content

AST: Begin refactoring AvailabilitySpec to support custom domains #79312

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 4 commits into from
Feb 12, 2025

Conversation

tshortli
Copy link
Contributor

Hollow out each of the AvailabilitySpec subclasses in preparation for adding custom availability domain support to if #available(...) queries. AvailabilitySpec should eventually become nothing but a bag of parsed details that must be queried via a request to resolve its availability domain, instead of eagerly resolving the domain during parsing. The next step will be to remove the subclasses entirely.

Include it where it's actually used instead to improve compile times.
Instead of canonicalizing platform versions during parsing and storing two
versions, just canonicalize the parsed version on-demand when its requested.
Push all of the members up into the AvailabilitySpec superclass in preparation
for removing the subclasses.

NFC.
Remove methods that are specific to AvailabilitySpec subclasses and replace
them with methods on the superclass if necessary.

NFC.
@tshortli tshortli changed the title AST: Begin refactoring AvailabilitySpec to support arbitrary domains AST: Begin refactoring AvailabilitySpec to support custom domains Feb 12, 2025
@tshortli
Copy link
Contributor Author

@swift-ci please test

@tshortli tshortli merged commit 30bd7d9 into swiftlang:main Feb 12, 2025
5 checks passed
@tshortli tshortli deleted the availability-spec-gardening branch February 12, 2025 14:55
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