Skip to content

Instantly share code, notes, and snippets.

@tarunon
Created January 15, 2016 08:58
Show Gist options
  • Save tarunon/32238ce0993403eef4c5 to your computer and use it in GitHub Desktop.
Save tarunon/32238ce0993403eef4c5 to your computer and use it in GitHub Desktop.
workaround wildcard ErrorType generics.
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