Created
January 15, 2016 08:58
-
-
Save tarunon/32238ce0993403eef4c5 to your computer and use it in GitHub Desktop.
workaround wildcard ErrorType generics.
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 UIKit | |
enum Error: ErrorType { | |
case ERROR(ErrorType) | |
} | |
var error: ErrorType = Error.ERROR(NSCocoaError.CoderReadCorruptError) | |
switch error { | |
case Error.ERROR(NSCocoaError.CoderReadCorruptError): | |
print(0) | |
default: | |
break | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment