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-8351] Class with @objcMembers annotation and a bool property fail with error on non-Apple platforms #50879

Open
swift-ci opened this issue Jul 24, 2018 · 2 comments
Labels
bug A deviation from expected or documented behavior. Also: expected but undesirable behavior. compiler The Swift compiler in itself

Comments

@swift-ci
Copy link
Collaborator

Previous ID SR-8351
Radar None
Original Reporter skela (JIRA User)
Type Bug

Attachment: Download

Environment

Linux Swift 4.1

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

md5: 287e65c4f37603a06f01779cf622035d

relates to:

Issue Description:

It appears that a NSObject subclass with the @objcMembers and a bool property fail to build on Linux. Commenting out the @objcMembers annotation, and it builds fine. Likewise, leaving the @objcMembers annotation on there and changing the bool property to an int property, also compiles fine.

<unknown>:0: error: could not find Objective-C bridge type for type 'Bool'; did you forget to import Foundation?
<unknown>:0: error: fatal error encountered during compilation; please file a bug report with your project and the crash log
<unknown>:0: note: unable to set up the ObjC bridge!

Is there any way to workaround this? I've tried

#if os(iOS) @objcMembers #endif

without any luck.

@belkadan
Copy link
Contributor

I don't think you're even supposed to use @objcMembers on Linux, but that puts this in the same camp as SR-3332.

@swift-ci
Copy link
Collaborator Author

Comment by Alek Slater (JIRA)

Yeah, I mean I don't need the objc stuff in Linux obviously, but I'm using the same code on iOS as I plan to on Linux.

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
Projects
None yet
Development

No branches or pull requests

2 participants