[SR-9867] [5.0 Regression] Can't expose unavailable properties marked with unavailable #52273
Labels
bug
A deviation from expected or documented behavior. Also: expected but undesirable behavior.
compiler
The Swift compiler in itself
regression
swift 5.0
Attachment: Download
Environment
Version 10.2 beta 2 (10P91b)
MacOS Mojave 10.14.2
(Had the same issue on beta 1)
Additional Detail from JIRA
md5: e2be01b96240922d51580134704e686e
Issue Description:
Sorry for the undescriptive title of the issue
I have an iOS framework that requires extension-safe APIs (i.e. APPLICATION_EXTENSION_API_ONLY = YES)
In that framework I have a class defined as such:
This compiles OK. But now I add another class that exposes this
UnavailableClass
as a property (the property is marked as unavailable as well)This does not compile with the Swift 5 compiler (neither on Swift 4.2.x mode nor on Swift 5 mode)
The error varies a bit depending how you declare that variable, and if the unavailable class comes from Swift or Objc, I've seen:
'Xxxx' is unavailable
'Xxxx' is unavailable: This class cannot be used from extension targets
I attach a sample project that demonstrates the issue, the project compiles fine on Xcode 10.1 (Swift 4.2.x), but fails to compile on Xcode 10.2 (both beta 1 and beta 2)
EDIT: Additional info: if I turn the property into a function, it does work.
The text was updated successfully, but these errors were encountered: