Created
January 21, 2016 16:31
-
-
Save illicitonion/c9ffeea516fb8cff92bd to your computer and use it in GitHub Desktop.
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 foo(n: Int) -> Int { | |
switch(n) { | |
case 0: | |
return 1 | |
default: | |
return n | |
} | |
} | |
Missing return in a function expected to return 'Int' | |
func foo(n: Int) -> Int { | |
switch(n) { | |
case 0: | |
return 1 | |
} | |
return n | |
} | |
Switch must be exhaustive, consider adding a default clause | |
func foo(n: Int) -> Int { | |
switch(n) { | |
case 0: | |
return 1 | |
default: | |
return n | |
} | |
return n | |
} | |
Bingo |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment