Skip to content

Conversation

tshortli
Copy link
Contributor

@tshortli tshortli commented Sep 4, 2025

Declarations that are unavailable at runtime because of an @available attribute referencing a custom domain that was imported @_spiOnly should be hidden from public swiftinterface files in -library-level=api modules. For remaining declarations that do get printed in the public swiftinterface, skip printing any @available attribute that refers to the domains from those @_spiOnly dependencies. This allows API developers to control declaration visibility using availability defined by another module.

Resolves rdar://156512028.

…erfaces.

All supported compilers can now parse `@available` attributes that reference
custom availability domains.
This is meant to make it clearer how exceptions for each `DisallowedOriginKind`
are handled.
@tshortli
Copy link
Contributor Author

tshortli commented Sep 4, 2025

@swift-ci please smoke test

@tshortli tshortli requested review from xymus and nkcsgexi September 4, 2025 16:27
…faces.

Declarations that are unavailable at runtime because of an `@available`
attribute referencing a custom domain that was imported `@_spiOnly` should be
hidden from public swiftinterface files in `-library-level=api` modules. For
remaining declarations that do get printed in the public swiftinterface, skip
printing any `@available` attribute that refers to the domains from those
`@_spiOnly` dependencies. This allows API developers to control declaration
visibility using availability defined by another module.

Resolves rdar://156512028.
@tshortli tshortli force-pushed the custom-availability-in-library-level-api-swiftinterfaces branch from ba47d27 to b047396 Compare September 4, 2025 19:32
@tshortli
Copy link
Contributor Author

tshortli commented Sep 4, 2025

@swift-ci please smoke test

@tshortli tshortli enabled auto-merge September 4, 2025 19:32
@tshortli tshortli merged commit 5f67a9a into swiftlang:main Sep 5, 2025
3 checks passed
@tshortli tshortli deleted the custom-availability-in-library-level-api-swiftinterfaces branch September 5, 2025 02:56
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