https://kotlinlang.org logo
Title
s

SrSouza

07/07/2019, 11:08 PM
Hi guys, I want to know if this is a bug or anyone can explain this. The setValue is okay with this error, but why the getValue don't give me the same error?
l

louiscad

07/07/2019, 11:40 PM
We can't see what is the actual error in your screenshot. BTW, you could use
ReadWriteProperty
from Kotlin stdlib here
s

SrSouza

07/07/2019, 11:56 PM
@louiscad a create a Interface just for Nullable types with Generic types, but, when a I use it, just the setValue the Compiler is forcing to be nullable and the getValue not, this is the problem.
l

louiscad

07/08/2019, 12:00 AM
You could try with
out
variance on the type parameter of the interface. I don't see the code on
setValue
though, so I can't help much…