Skip to content

Instantly share code, notes, and snippets.

@kmizu
Created April 25, 2018 16:18
Show Gist options
  • Save kmizu/c40437f11c65b0a1fe8357c98dfe3ed3 to your computer and use it in GitHub Desktop.
Save kmizu/c40437f11c65b0a1fe8357c98dfe3ed3 to your computer and use it in GitHub Desktop.
Overloading by arity of methods
object O {
def f: Int = 0
def f(x: Int): Int = x
def main(args: Array[String]): Unit = {
println(f)
println(f(3))
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment