Skip to content

Instantly share code, notes, and snippets.

@sajjadyousefnia
Created May 3, 2018 05:32
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 sajjadyousefnia/64007cf8a114cefdc7e086225238b345 to your computer and use it in GitHub Desktop.
Save sajjadyousefnia/64007cf8a114cefdc7e086225238b345 to your computer and use it in GitHub Desktop.
fun printNumbers(myDouble: Double, vararg ints: Int, myFloat: Float) {
println(myDouble)
println(myFloat)
for (n in ints) {
print("$n\t")
}
}
printNumbers(1.34, 2, 3, 4, 5, 6, myFloat = 4.4F) // will compile
printNumbers(1.34, ints = 2, 3, 4, 5, 6, myFloat = 4.4F) // will not compile
printNumbers(myDouble = 1.34, ints = 2, 3, 4, 5, 6, myFloat = 4.4F) // will also not compile
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment