|
|
| Previous ID |
SR-1226 |
| Radar |
rdar://problem/34949130 |
| Original Reporter |
kaybutter (JIRA User) |
| Type |
Bug |
Environment
Xcode 7.3 with Swift 2.2
Additional Detail from JIRA
|
|
| Votes |
10 |
| Component/s |
Compiler |
| Labels |
Bug |
| Assignee |
None |
| Priority |
Medium |
md5: 51ba9fd65347cc3638554b002b1937f1
Issue Description:
I am writing a dynamic framework used both by an iOS application target and an iOS extension target. The framework is marked with the "allow app extension API only" flag.
The following swift code from the framework will fail to compile:
@available(iOSApplicationExtension, unavailable)
func test() {
_ = UIApplication.sharedApplication()
}
The Objective-C version, using NS_EXTENSION_UNAVAILABLE will compile:
- (void)test NS_EXTENSION_UNAVAILABLE("don't use this in extensions") {
[UIApplication sharedApplication];
}
Expected Behavior:
@available(iOSApplicationExtension, unavailable) should behave like NS_EXTENSION_UNAVAILABLE. Methods or classes marked as available in extensions should be allowed to use APIs not available for extensions.
Environment
Xcode 7.3 with Swift 2.2
Additional Detail from JIRA
md5: 51ba9fd65347cc3638554b002b1937f1
Issue Description:
I am writing a dynamic framework used both by an iOS application target and an iOS extension target. The framework is marked with the "allow app extension API only" flag.
The following swift code from the framework will fail to compile:
The Objective-C version, using
NS_EXTENSION_UNAVAILABLEwill compile:Expected Behavior:
@available(iOSApplicationExtension, unavailable)should behave likeNS_EXTENSION_UNAVAILABLE. Methods or classes marked as available in extensions should be allowed to use APIs not available for extensions.