Created
August 7, 2020 05:51
-
-
Save husen-hn/a8f717844c3076b7b666e8f8ed084d94 to your computer and use it in GitHub Desktop.
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
data class MyData(var value: String) | |
fun main() { | |
var mutable = MyData("Foo") | |
val immutable = MyData("Bar") | |
mutable = immutable // This is fine | |
immutable = mutable // This will not compile | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment