0

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.

scout
  • 2,336
  • 4
  • 21
  • 22

1 Answers1

0

Function objects don't have default values. The type of k is (Int, Int) => Int.

Jean-Philippe Pellet
  • 59,296
  • 21
  • 173
  • 234