Can someone explain why the code below compiles ?
I think it should not compile.
object RandomExperiments extends App{
def takeTuple(t:(Int,Int))=print (s"$t ${t._1}\n")
takeTuple(1,3) // this should not compile !!!
takeTuple (1,3) // this should not compile !!!
takeTuple((1,3))
takeTuple(((1,3)))
def takeTwoInts(i1:Int,i2:Int)=print (s"$i1 $i2\n")
takeTwoInts(1,2)
// takeTwoInts((1,2)) // does not compile , this is expected
}
(1,3) 1
(1,3) 1
(1,3) 1
(1,3) 1
1 2