Let's say I have class C with some methods
def class C { def f1():Int = ... def f2():Int = ... }
Now I need a method that accepts two instances of C, as well as a C method, but I donβt know what types f1, f2 are and how to call them. I think it will look like
def cmp(first:C, second:C, t:() => Int): Boolean = { first.t < second.t }
It complains that t is not method C. Of course, there must be a way to express this.
scala
Mike kraley
source share