Skip to content

sema: diagnose @_spi_available on all platforms #60983

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 1 commit into from
Sep 8, 2022

Conversation

nkcsgexi
Copy link
Contributor

@nkcsgexi nkcsgexi commented Sep 7, 2022

@_spi_available should only be used when the symbol is publically available in some deployment platforms, otherwise, we should use @_spi.

@nkcsgexi
Copy link
Contributor Author

nkcsgexi commented Sep 7, 2022

@swift-ci please smoke test

@nkcsgexi nkcsgexi requested a review from tshortli September 7, 2022 20:15
@_spi_available should only be used when the symbol is publically available in some deployment
platforms, otherwise we should use @_spi.
@nkcsgexi nkcsgexi force-pushed the warn-all-spi-available branch from a24c2ae to 4f9cfd3 Compare September 7, 2022 20:21
@nkcsgexi
Copy link
Contributor Author

nkcsgexi commented Sep 7, 2022

@swift-ci please smoke test

@tshortli
Copy link
Contributor

tshortli commented Sep 7, 2022

I think this diagnostic overall makes sense, and perhaps this is an edge case, but a missing availability annotation for a specific platform is expected in some circumstances, like for the standard library or any other library that is available at the start of a platform. Therefore enumerating all explicit annotations doesn't really answer the question of whether a declarations is SPI available on all platforms relevant to the module, since declarations are implicitly always available on platforms without annotations. So this diagnostic may be misleading in a small set of scenarios.

@nkcsgexi nkcsgexi merged commit ea21d32 into swiftlang:main Sep 8, 2022
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