Think about the code below:

object My extends App {
        def increment(key: Any) {
        increment("world", 6, 7);

I intent to see the compiler error for second ‘increment’ int the first place. But it don’t, the compiler report ok and the output of the program is:


The compiler recognize the three arguments “world”, “6”, “7” as a tuple of (“world”, 6, 7). So the correct type of arugment for function ‘increment’ should be ‘String’:

def increment(key: String) {