Open erikwright opened 5 years ago
Hi @erikwright ;) ! It seems to me that error means that trying to run this code
def f(x1: Int, x2: Int) = x1 + x2 ; f
You're missing the arguments if you want to apply f, which you could fix like this
val nine = f(4, 5)
Or maybe you want to pass f as a parameter to a higher order function, in which case could use
f _
or
f(_, _)
in this way
def sum(f: (Int, Int) => Int, a: Int, b: Int): Int = f(a, b)
sum(f _, 4, 5)
https://github.com/scala-exercises/exercises-scalatutorial/blob/master/src/main/scala/scalatutorial/sections/HigherOrderFunctions.scala#L126-L138
If I try to run code like this, I get: