@_spi and enum cases

Hello everyone.

Wondering if I have encountered a bug, or if this is by design.
I am marking an enum case with @_spi, however it still appears in my .swiftinterface file, without @_spi marking. When generating with -emit-private-module-interface-path, the case is correctly marked with @_spi in the private.swiftinterface file.
Is @_spi designed to hide a particular enum case?

This is a bug. @_spi cannot be used to hide enum cases from clients in this way - though it could be made to work for resilient enums*. This is tracked as rdar://72873771

*It is unsound to do so if the enum itself is @frozen since public and private clients will compute different layouts for the same type.

2 Likes

Thanks for taking time to respond!
Do I understand it correctly, the actual bug is that the compiler does not give an error when marking a particular enum case with @_spi ?