![]() Var local variables - if the variable is not modified between the check and the usage, is not captured in a lambda that modifies it, and is not a local delegated property. Smart casts cannot be used on open properties or properties that have custom getters. Val properties - if the property is private or internal or if the check is performed in the same module where the property is declared. ![]() Val local variables - always, with the exception of local delegated properties. More specifically, smart casts can be used under the following conditions: Note that smart casts work only when the compiler can guarantee that the variable won't change between the check and the usage.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |