Created
March 9, 2016 21:26
-
-
Save sylvanaar/3315139169a0c9bc4877 to your computer and use it in GitHub Desktop.
ambiguous reference
This file contains 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
// Ojc Category on NSError | |
@interface NSError (MyCategory) | |
+ (NSError *) clientErrorWithCode: (NSInteger) code; | |
@end | |
// Swift Error Enum | |
@objc enum AppError : Int { | |
case Foo = 0 | |
case Bar = 1 | |
} | |
// Swift Extension on NSError | |
extension NSError { | |
func clientErrorWithCode(code:AppError) { | |
NSError.clientErrorWithCode(code.rawValue) | |
} | |
} | |
// Try to use: | |
let error = NSError.clientErrorWithCode(.Foo) // Error: Error:(268, 40) ambiguous reference to member 'clientErrorWithCode' | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment