Data flow info always taken into account in safeGetType()

The dangerous method removed
This commit is contained in:
Andrey Breslav
2012-05-13 12:49:25 +04:00
parent cccff99d9e
commit cf3091adb5
8 changed files with 31 additions and 9 deletions
@@ -0,0 +1,7 @@
class C(val f : () -> Unit)
fun test(e : Any) {
if (e is C) {
(e.f)()
}
}
@@ -0,0 +1,7 @@
class C(val f : Int)
fun test(e : Any) {
if (e is C) {
#(e.f)
}
}
@@ -0,0 +1,10 @@
trait Expr
class BinOp(val operator : String) : Expr
fun test(e : Expr) {
if (e is BinOp) {
when (e.operator) {
else -> 0
}
}
}