Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[SR-10973] Inner compiler-directive are resolved even when outer one isn't met #53362

Closed
swift-ci opened this issue Jun 19, 2019 · 2 comments
Closed
Labels
bug A deviation from expected or documented behavior. Also: expected but undesirable behavior. compiler The Swift compiler in itself parser Area → compiler: The legacy C++ parser

Comments

@swift-ci
Copy link
Collaborator

Previous ID SR-10973
Radar None
Original Reporter freak4pc (JIRA User)
Type Bug
Status Resolved
Resolution Done

Attachment: Download

Additional Detail from JIRA
Votes 0
Component/s Compiler
Labels Bug, Parser
Assignee None
Priority Medium

md5: 9be50ef16b2a2cc655d04bca5f6bd1f6

Issue Description:

I've been trying to add support to one of my libraries for UIKitForMac, and at one place I need to add something along the lines of

#if targetEnvironment(UIKitForMac)

In Xcode 10, this generates a warning. I was hoping I could avoid it by wrapping this in a compiler check, but that emits a warning as well:

This seems like a bug - I wouldn't expect the inner part to even be resolved, since the compiler directive isn't met.

Running with Xcode 10.2.1, Swift 5.0.1 compiler.

@harlanhaskins
Copy link
Collaborator

This may have been fixed by #25593

@rintaro if you have a local build handy, can you verify that this is the case?

@swift-ci
Copy link
Collaborator Author

Comment by Shai Mishali (JIRA)

Thank you @harlanhaskins, That does look like the right fix 🙂

I guess it will only be relevant for the final Swift 5.1 GM compiler, so the issue is still expected to persist under Xcode 10 / Swift 5.0.1 ?

@swift-ci swift-ci transferred this issue from apple/swift-issues Apr 25, 2022
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug A deviation from expected or documented behavior. Also: expected but undesirable behavior. compiler The Swift compiler in itself parser Area → compiler: The legacy C++ parser
Projects
None yet
Development

No branches or pull requests

2 participants