Last active
January 16, 2016 19:43
-
-
Save hanawat/4e2e8d27fb53befa637f to your computer and use it in GitHub Desktop.
When not using return value, compiler issues a warning.
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
@warn_unused_result(message = "Use the result fuckathon") | |
func area(height height: Double, width: Double) -> Double { | |
return height * width | |
} | |
area(height: 2.0, width: 3.0) // Compile Error: Use the result fuckathon |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment