Skip to content

Instantly share code, notes, and snippets.

@jasdev
Created July 14, 2016 02:05
Show Gist options
  • Save jasdev/9baeb146381cd2ba511125ab8b0e88a0 to your computer and use it in GitHub Desktop.
Save jasdev/9baeb146381cd2ba511125ab8b0e88a0 to your computer and use it in GitHub Desktop.
An attempt at a protocol that can imply the present of specific cases
import Foundation
public protocol FoundationErrorWrapper: ErrorProtocol {
static func wrappingError(_ error: NSError) -> Self
}
enum SomeError: ErrorProtocol, FoundationErrorWrapper {
case a
case wrappingError(NSError)
}
enum SomeOtherError: ErrorProtocol, FoundationErrorWrapper {
case b
case wrappingError(NSError)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment