Created
July 1, 2016 16:13
-
-
Save timshadel/3ec5ff204eab9cd9c0bcaefeebc63285 to your computer and use it in GitHub Desktop.
From Dave D.
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
infix operator !! { associativity left precedence 160 } | |
@inline(__always) public func !!<T>(value: T?, @autoclosure die: () -> Void) -> T { | |
guard let value = value else { | |
die() | |
exit(-1) | |
} | |
return value | |
} | |
let test: String? = nil | |
let foo = test !! fatalError("what?!") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment