[FIR] Fix taking symbol of expression with smartcast inside DFA

This commit is contained in:
Dmitriy Novozhilov
2021-02-17 17:38:23 +03:00
parent adb05ab076
commit 9b4949a3c5
6 changed files with 46 additions and 1 deletions
@@ -0,0 +1,14 @@
FILE: thisAssignment.kt
public abstract interface A : R|kotlin/Any| {
public abstract fun foo(): R|kotlin/Unit|
}
public final fun R|kotlin/Any|.test(): R|kotlin/Unit| {
when () {
(this@R|/test| is R|A|) -> {
lval a: R|kotlin/Any| = this@R|/test|
R|<local>/a|.R|/A.foo|()
}
}
}
@@ -0,0 +1,12 @@
interface A {
fun foo()
}
fun Any.test() {
if (this is A) {
val a = this
a.foo()
}
}