Skip to content

Instantly share code, notes, and snippets.

@jasdev
Created July 14, 2016 02:05
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