Data flow info always taken into account in safeGetType()
The dangerous method removed
This commit is contained in:
@@ -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
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user