Hey folks, I’ve got a method that takes, as one of its arguments,
func: Function<Foo, Bar>
. Elsewhere in the code, when calling it, I’m trying to pass in
{ it.baz }
where it is type Foo, and baz is type Bar. But it’s giving me
unresolved reference: it
and saying that the type of the lambda is
() -> [ERROR:]
. If I prefix it with the word Function,
Function { it.baz}
it works.
a
Andreas Sinz
06/26/2018, 2:51 PM
Function<Foo, Bar>
is a java interface?
m
Michael
06/26/2018, 3:10 PM
Yeah. I’m realizing now (trying to debug a coworker’s code) that he was using “kotlin.test.assertEquals”, which is <T,T> which is also breaking the compiler, because the literal on the left isn’t nullable. I thought that was junit’s assertEquals.