-
-
Save owensd/0724d2e66f49c68251d7 to your computer and use it in GitHub Desktop.
The joys of "no safety" builds.
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
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