Skip to content

Instantly share code, notes, and snippets.

@ngsw-taro
Created June 3, 2012 10:15
Show Gist options
  • Save ngsw-taro/2862913 to your computer and use it in GitHub Desktop.
Save ngsw-taro/2862913 to your computer and use it in GitHub Desktop.
class Foo<out T>() {
var value : T? = null
}
fun main(args : Array<String>) {
val a : Foo<Int> = Foo<Int>()
a.value = 5
val b : Foo<Number> = a
b.value = 2.0
println(a.value) // 2.0
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment