Skip to content

Instantly share code, notes, and snippets.

@ukitaka
Created December 13, 2016 09:13
Show Gist options
  • Select an option

  • Save ukitaka/277c8d4e3a66c9c919694de75031d95f to your computer and use it in GitHub Desktop.

Select an option

Save ukitaka/277c8d4e3a66c9c919694de75031d95f to your computer and use it in GitHub Desktop.
fatalErrorT
func fatalErrorT<T>() -> T {
fatalError()
}
func fatalErrorT<T>(_ message: String) -> T {
fatalError(message)
}
@ukitaka
Copy link
Author

ukitaka commented Dec 13, 2016

こうかける

let i: Int? = 123
let i2: Int = i ?? fatalErrorT() // ←こう

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment