Reputation: 15560
Given the function
def func(implicit x: Foo, y: Bar): (ThingA => ThingB) = ???`
I can't figure out how to call it on one line. Obviously this works by storing the returned function in a val:
val f = func // Foo and Bar are implicitly applied
f(ThingA)
but how to do it without the assignment to val? func(ThingA)
naturally complains that func
has been called with too few arguments.
Upvotes: 0
Views: 68
Reputation: 32719
The simplest is probably to explicitly call apply
:
func.apply(ThingA)
Upvotes: 5