Skip to content

Instantly share code, notes, and snippets.

@n-miyo
Created November 10, 2014 07:01
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save n-miyo/940befe8cbae1a87d32a to your computer and use it in GitHub Desktop.
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.
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)
@duanehomick
Copy link

Wow - thank god I found this post. I was pulling my hair out trying to figure out what the heck I did wrong...

@n-miyo
Copy link
Author

n-miyo commented Feb 12, 2015

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment