Created
October 18, 2019 06:35
-
-
Save mirokolodii/a24a5b8f6849d2104fa003bd5eca826e to your computer and use it in GitHub Desktop.
Switch to Kotlin #2.5
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var nullableStr: String? = null | |
var nonNullStr: String = "a string" | |
nullableStr = nonNullStr // valid | |
nonNullStr = nullableStr // error, should be checked for nullability first | |
If (nullableStr != null) { | |
nonNullStr = nullableStr // valid | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment