Skip to content

Instantly share code, notes, and snippets.

@owensd owensd/crash.swift Secret
Created Jul 16, 2015

Embed
What would you like to do?
The joys of "no safety" builds.
func test(n: Int) -> Int {
if n > 0 {
assertionFailure("🔥")
}
if n < 0 {
assertionFailure("💣")
}
return 101
}
test(0) // ok
test(1) // crash
test(-1) // crash
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.