Skip to content

Conversation

xymus
Copy link
Contributor

@xymus xymus commented Sep 16, 2025

Allow referencing an @_spi_available decl in extensions to @_spi_available types. This will unblock adopting the recent SDKs in CI as a swiftinterface has such a configuration. This is a narrow fix as it should really be handled as part of the context check but that check is currently too permissive.

Fow now let's narrowly allow legal code. And then we should look at revisiting the SPI availability logic, separate it from normal SPI and treat it more like availability.

  • Scope: Users of @_spi_available and clang SPI.
  • Risk: Low, this allows a very limited use case that would previously raise an error.
  • Testing: Added a test for the fixed behavior and to document related behaviors that will need to be revisited.
  • Reviewed-by: @tshortli
  • Resolves: rdar://159292698
  • Cherry-pick of: Sema: Narrow fix to allow @_spi_available in extensions #84238

Allow referencing an `@_spi_available` decl in extensions to
`@_spi_available` types. This is a narrow fix as it should really be
handled as part of the context check but that check is currently too
permissive.

Fow now let's narrowly allow legal code. And then we should look at
revisiting the SPI availability logic, separate it from normal SPI and
treat more like availability.

Adding a test comparing the behavior of `@_spi` with `@_spi_available`
to document the current implementation.

rdar://159292698
@xymus xymus requested a review from a team as a code owner September 16, 2025 20:15
@xymus
Copy link
Contributor Author

xymus commented Sep 16, 2025

@swift-ci Please test

@xymus xymus merged commit e037059 into swiftlang:release/6.2 Sep 17, 2025
5 checks passed
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