https://kotlinlang.org logo
Title
k

karelpeeters

04/12/2019, 4:25 PM
You want
<in T>
on the interface.
a

Alexey Subbota

04/12/2019, 4:27 PM
Did you answer me?
k

karelpeeters

04/12/2019, 4:28 PM
Yes 😒imple_smile:. I had the answer still typed up from when you deleted the code.
a

Alexey Subbota

04/12/2019, 4:29 PM
If I write so interface Sample<in T>{ fun foo(v:T) } The error is still present (
k

karelpeeters

04/12/2019, 4:30 PM
My bad. You probably do want
<in T>
on the interface, but that's not the problem here.
The actual problem is that SAM conversion only works for Java interfaces.
a

Alexey Subbota

04/12/2019, 4:35 PM
Wow! Thanks! What a pity...
k

karelpeeters

04/12/2019, 4:35 PM
Yeah I agree it's weird, the suggestion is to use higher order functions instead.
a

Alexey Subbota

04/12/2019, 4:37 PM
I will
g

ghedeon

04/12/2019, 8:25 PM