Skip to content

Instantly share code, notes, and snippets.

@husen-hn
Created August 7, 2020 05:51
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save husen-hn/a8f717844c3076b7b666e8f8ed084d94 to your computer and use it in GitHub Desktop.
Save husen-hn/a8f717844c3076b7b666e8f8ed084d94 to your computer and use it in GitHub Desktop.
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