Support for 'as' and temporary support for 'is'

This commit is contained in:
Valentin Kipyatkov
2016-08-25 01:13:05 +03:00
parent 1674beb64b
commit 5d427d8d2e
3 changed files with 22 additions and 0 deletions
@@ -198,6 +198,15 @@ private class Processor(
return true
}
}
is KtIsExpression -> {
return true //TODO!
}
is KtBinaryExpressionWithTypeRHS -> {
processSuspiciousExpression(typeRefParent)
return true
}
}
}
@@ -20,3 +20,14 @@ fun g() = A()
fun h() = g()
fun listOfA() = listOf<A>(A(1, "", ""))
fun x(o: Any) {
if (o is A) {
val (x, y) = o
}
}
fun y(o: Any) {
val list = o as List<A>
val (x, y) = list[0]
}
@@ -5,6 +5,8 @@
[dataClass.2.kt] Value read 11 val (x3, y3, z3) = h()
[dataClass.2.kt] Value read 13 val (x4, y4, z4) = listOfA()[0]
[dataClass.2.kt] Value read 15 val (x5, y5, z5) = javaClass.getA()[0]
[dataClass.2.kt] Value read 26 val (x, y) = o
[dataClass.2.kt] Value read 32 val (x, y) = list[0]
[dataClass.2.kt] Value read 5 a.n
[dataClass.2.kt] Value read 8 val (x, y, z) = a
[dataClass.2.kt] Value read 9 val (x1, y1, z1) = f()