Dominaezzz
08/15/2019, 10:12 PMthing
in data class Wrapper(val thing: String?)
(from another module of course).marstran
08/16/2019, 7:27 AMdiesieben07
08/16/2019, 7:42 AMmarstran
08/16/2019, 7:49 AMdiesieben07
08/16/2019, 7:50 AMval properties - if the property is private or internal or the check is performed in the same module where the property is declared. Smart casts aren't applicable to open properties or properties that have custom getters
marstran
08/16/2019, 8:01 AMNoSuchMethodError
. In this case, I think it would throw an NPE because of the null-check the compiler inserts when it smart casts.diesieben07
08/16/2019, 8:02 AMSo, changing the property to a custom getter or delegate would just be a breaking change.Yes, this is a tradeoff. The Kotlin creators chose to make this not a breaking change
marstran
08/16/2019, 8:02 AM