Skip to content

Instantly share code, notes, and snippets.

@etrepum
Created June 5, 2014 15:42
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 etrepum/4a6cb4960e207d8adfe8 to your computer and use it in GitHub Desktop.
Save etrepum/4a6cb4960e207d8adfe8 to your computer and use it in GitHub Desktop.
Welcome to Swift! Type :help for assistance.
1> func derp(a,b,c) { return a + b + c }
<REPL>:1:11: error: use of undeclared type 'a'
func derp(a,b,c) { return a + b + c }
^
<REPL>:1:13: error: use of undeclared type 'b'
func derp(a,b,c) { return a + b + c }
^
<REPL>:1:15: error: use of undeclared type 'c'
func derp(a,b,c) { return a + b + c }
^
1> func derp(a:Int,b:Int,c:Int) { return a + b + c }
<REPL>:1:45: error: could not find an overload for '+' that accepts the supplied arguments
func derp(a:Int,b:Int,c:Int) { return a + b + c }
~~~~~~^~~
1> func derp(a:Int,b:Int,c:Int) -> Int { return a + b + c }
2>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment