Open swift-ci opened 8 years ago
Please attach a self-contained test case, so that we know we're seeing the same issue. (It's very possible this is an Xcode issue rather than a Swift issue, in which case this would not be the right place to file it.)
Comment by James Campbell (JIRA)
I've attached a project. This works in Xcode 7.2 but not Xcode 7.3.
Comment by Joaquin (JIRA)
Is there any updates on this? I'm facing the same problem with Xcode 7.3
Comment by James Campbell (JIRA)
Patrono (JIRA User) The compiler team said that this was unintended behaviour in earlier version of Swift.
To still use it you have to bridge the macros in like so:
Macros.h (Included in the bridging header):
static NSString * const kENDPOINT_MACRO = ENDPOINT_MACRO;
Code.swift:
print(kENDPOINT_MACRO)
Comment by Joaquin (JIRA)
jscampbell05 (JIRA User) thanks for that solution!
If this is the desired behavior, should this task be closed as invalid?
Attachment: Download
Environment
Xcode 7.3, OS X 10.11, Swift 2.2Additional Detail from JIRA
| | | |------------------|-----------------| |Votes | 0 | |Component/s | Compiler | |Labels | Bug, ClangImporter | |Assignee | None | |Priority | Medium | md5: 2f6f4152186372585254b5d992921f7cIssue Description:
We are experiencing an issue when compiling swift code under Xcode 7.3.
Preprocessor macros specified in the Xcode Project aren't imported into swift. Ones manually declared in code are imported fine.
Specifying Xcode 7.3 to use the Xcode 7.2 toolchain (Swift 2.1 etc) has no effect on this.
This is preventing us from using Xcode 7.3 and being able to test for 9.3. Anybody else getting this issue?