Dominaezzz08/15/2019, 10:12 PM
(from another module of course).
data class Wrapper(val thing: String?)
marstran08/16/2019, 7:27 AM
diesieben0708/16/2019, 7:42 AM
marstran08/16/2019, 7:49 AM
diesieben0708/16/2019, 7:50 AM
val 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
marstran08/16/2019, 8:01 AM
. In this case, I think it would throw an NPE because of the null-check the compiler inserts when it smart casts.
diesieben0708/16/2019, 8:02 AM
So, 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
marstran08/16/2019, 8:02 AM