FIR2IR: fix smart casts in case field is accessed

This commit is contained in:
Mikhail Glukhikh
2021-01-25 13:49:40 +03:00
parent 1c9064836e
commit 1a4b327210
8 changed files with 189 additions and 6 deletions
+24
View File
@@ -0,0 +1,24 @@
// FILE: JCTree.java
public class JCTree {
public abstract static class JCExpression extends JCTree {
}
public static class JCTypeApply extends JCExpression {
public String clazz = "OK";
}
}
// FILE: JCTreeUser.kt
class Owner<out T : JCTree>(val tree: T) {
val foo: String
get() {
var tree: JCTree = tree
if (tree is JCTree.JCTypeApply) {
return tree.clazz
}
return "";
}
}