use hard-coded TypeInfo instances for primitive types

This commit is contained in:
Dmitry Jemerov
2011-06-30 17:18:16 +02:00
parent 8a1b9933e4
commit 01a08ecd04
5 changed files with 48 additions and 1 deletions
@@ -0,0 +1,13 @@
class Box<T>(t: T) {
var value = t
}
fun isIntBox(box: Box<out Any?>): Boolean {
return box is Box<Int>;
}
fun box(): String {
val box = Box<Int>(1)
return if (isIntBox(box)) "OK" else "fail"
}