Skip to content

Instantly share code, notes, and snippets.

@owensd
Created July 16, 2015 01:40
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save owensd/0724d2e66f49c68251d7 to your computer and use it in GitHub Desktop.
Save owensd/0724d2e66f49c68251d7 to your computer and use it in GitHub Desktop.
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