Created
November 10, 2014 07:01
-
-
Save n-miyo/940befe8cbae1a87d32a to your computer and use it in GitHub Desktop.
Link error will be occurred if a Swift class inherits NSObject with single case enum typed property.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import Foundation | |
enum E { | |
case A | |
//, B | |
} | |
class C//: NSObject | |
{ | |
var e: E | |
init(e: E) { | |
self.e = e | |
} | |
} | |
var c = C(e:.A) | |
// Link error will be occurred if C inherits NSObject | |
// with single case enum variable. | |
// Undefined symbols for architecture x86_64: | |
// "__TWvdvC3Foo1C1eOS_1E", referenced from: | |
// __TFC3Foo1Cm1eOS_1E in main.o | |
// ld: symbol(s) not found for architecture x86_64 | |
// clang: error: linker command failed with exit code 1 (use -v to see invocation) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Apple tells me that this bug is fixed on Xcode 6.3 beta with Swift 1.2. I checked it and confirmed this issue is resolved.