Skip to content

AST: Teach AvailabilityContext to represent version-less availability #79807

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

@tshortli tshortli commented Mar 5, 2025

This enables potential unavailability diagnostics to be emitted for decls that are only available in a version-less domain.

@tshortli tshortli enabled auto-merge March 5, 2025 23:21
@grynspan

This comment was marked as outdated.

@tshortli tshortli force-pushed the availability-context-available-custom-domains branch from d617383 to 6007a19 Compare March 6, 2025 03:09
… queries.

Introduction, deprecation, and obsoleteion ranges should only be returned by
the accessors on `SemanticAvailableAttr` when the attribute actually has an
affect on the corresponding kind of availability.
@tshortli tshortli force-pushed the availability-context-available-custom-domains branch from 6007a19 to 51a77d2 Compare March 6, 2025 21:03
…ersion.

This allows `X is only available in` diagnostics to be emitted for potential
unavailability in domains that do not support versioning.
@tshortli tshortli force-pushed the availability-context-available-custom-domains branch 2 times, most recently from 2523b69 to 56e5d8a Compare March 6, 2025 21:59
@tshortli
Copy link
Contributor Author

tshortli commented Mar 7, 2025

swiftlang/swift-testing#1002

@swift-ci please test Linux

This enables potential unavailability diagnostics to be emitted for decls that
are only available in version-less domains.
@tshortli tshortli force-pushed the availability-context-available-custom-domains branch from 56e5d8a to 0462cfd Compare March 7, 2025 06:30
@tshortli
Copy link
Contributor Author

tshortli commented Mar 7, 2025

swiftlang/swift-testing#1002

@swift-ci please smoke test

@tshortli tshortli merged commit 35fed04 into swiftlang:main Mar 7, 2025
3 checks passed
@tshortli tshortli deleted the availability-context-available-custom-domains branch March 7, 2025 14:20
tshortli added a commit to tshortli/swift that referenced this pull request Mar 20, 2025
swiftlang#79807 caused a regression in which
`AvailabilityContext` stopped tracking the available version range for the
active platform domain for certain platforms. Fix this by reverting to checking
`AvailabilityDomain::isActive()` to determine when a given platform
`AvailabilityDomain` represents the target platform. The compiler's existing
mapping from target triple to platform domain is incomplete and it's not clear
to me whether fixing that could cause other regressions.

Resolves rdar://147413616.
tshortli added a commit to tshortli/swift that referenced this pull request Mar 20, 2025
swiftlang#79807 caused a regression in which
`AvailabilityContext` stopped tracking the available version range for the
active platform domain for certain platforms. Fix this by reverting to checking
`AvailabilityDomain::isActive()` to determine when a given platform
`AvailabilityDomain` represents the target platform. The compiler's existing
mapping from target triple to platform domain is incomplete and it's not clear
to me whether fixing that could cause other regressions.

Resolves rdar://147413616.
tshortli added a commit to tshortli/swift that referenced this pull request Mar 20, 2025
swiftlang#79807 caused a regression in which
`AvailabilityContext` stopped tracking the available version range for the
active platform domain for certain platforms. Fix this by reverting to checking
`AvailabilityDomain::isActive()` to determine when a given platform
`AvailabilityDomain` represents the target platform. The compiler's existing
mapping from target triple to platform domain is incomplete and it's not clear
to me whether fixing that could cause other regressions.

Resolves rdar://147413616.
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