Improve the ergonomics of working with the Symbol.Availability.Domain
constants
#90
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Bug/issue #, if applicable:
Summary
This improves the ergonomics of creating
Symbol.Availability.Domain
values for known constants.Currently, because the constants are string values, creating a domain value for a known domain looks like:
with these changes, creating the same domain value looks like:
Warning
This is an API breaking change
I tried to avoid making API breaking changes here but I didn't really like any of the alternatives. The least bad workaround I could think of was:
What I don't like about it is that after the 6.2 release we're either going to have API that doesn't follow Swift's API Design Guidelines (because it repeats the type name in the property name) or we're going to have to deprecate it again to rename it back to just "swift".
I have some hopes that this API is nearly unused in practice because the current ergonomics are so bad that I'd expect that someone would have complained about it if anyone was using it.
Dependencies
This doesn't depend on anything but it's a breaking change for other repos.
Testing
Nothing in particular. This isn't a user-facing change.
Checklist
Make sure you check off the following items. If they cannot be completed, provide a reason.
./bin/test
script and it succeeded