Skip to content

Instantly share code, notes, and snippets.

@illicitonion
Created January 21, 2016 16:31
Show Gist options
  • Save illicitonion/c9ffeea516fb8cff92bd to your computer and use it in GitHub Desktop.
Save illicitonion/c9ffeea516fb8cff92bd to your computer and use it in GitHub Desktop.
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