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
@@ -0,0 +1,21 @@
class Owner<out T : JCTree> {
constructor(tree: T) /* primary */ {
super/*Any*/()
/* <init>() */
}
val tree: T
field = tree
get
val foo: String
get(): String {
var tree: JCTree = <this>.<get-tree>()
when {
tree /*as T */ is JCTypeApply -> return tree /*as JCTypeApply */.#clazz /*!! String */
}
return ""
}
}