Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
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