[SR-6399] Compilation failures on linux when adding @objc
annotations to types that bridge to ObjC classes
#48949
Labels
bug
A deviation from expected or documented behavior. Also: expected but undesirable behavior.
Environment
When on mac:
Mac OS 10.12.6
Xcode 9.1 with default toolchain
When on linux:
Ubuntu 16.04
Swift 4.0.2
Additional Detail from JIRA
md5: e811e3fd4cc1a74a6c66cea39cbebcd9
duplicates:
Issue Description:
If you have some swift code that exports properties or functions to objc using the @objc annotation, and those properties or functions reference types that automatically bridge to foundation object types like NSString/NSDictionary/etc, the code will compile on macOS successfully but will fail to compile on linux.
Some simple example code:
This compiles just fine on mac, but gives these errors/notes on linux:
The same thing happens for properties where the type is inferred to be something like String. This is problematic since I'd love to be able to run the same library on Linux that we run on iOS, in order to develop integration testing tools that verify that changes to the server do not negatively impact existing customers of our iOS apps. The code in question is compiled in swift 4 mode, which means we need to provide these annotations for the obj-c code in our codebase.
The text was updated successfully, but these errors were encountered: