def addition(a:Int, b:Int = 5) = a + b
val k = addition _
k(2) //This does not work
Also If I want to pass k as a parameter to another function what should be the signature of that function.
def addition(a:Int, b:Int = 5) = a + b
val k = addition _
k(2) //This does not work
Also If I want to pass k as a parameter to another function what should be the signature of that function.
Function objects don't have default values. The type of k
is (Int, Int) => Int
.