Created
July 14, 2016 02:05
-
-
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
This file contains 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 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