<@U5QGY080J> I have done similar code for Android...
# announcements
a
@iex I have done similar code for Android. I think the compiler can't look in a broader context, specially latter when you probably doing a switch case and trusting smart cast to get
value
with the right type
T
. If the compiler only looks to the class definitions, it may think that :
Copy code
sealed class Result
data class Success<out T>(val value: T): Result()
data class Error(val msg: String): Result()
would be enough.