FIR checker: make unused checker handle invoke properly

#KT-43688 Fixed
This commit is contained in:
Jinseong Jeon
2020-12-01 15:23:16 -08:00
committed by Mikhail Glukhikh
parent d907c48d9c
commit 44c6ec2c44
5 changed files with 50 additions and 1 deletions
@@ -0,0 +1,5 @@
fun foo(): Int {
val x = fun() = 4
val y = fun() = 2
return 10 * x() + y()
}
@@ -0,0 +1,12 @@
FILE: invoke.kt
public final fun foo(): R|kotlin/Int| {
lval x: R|() -> kotlin/Int| = fun <anonymous>(): R|kotlin/Int| {
^ Int(4)
}
lval y: R|() -> kotlin/Int| = fun <anonymous>(): R|kotlin/Int| {
^ Int(2)
}
^foo Int(10).R|kotlin/Int.times|(R|<local>/x|.R|SubstitutionOverride<kotlin/Function0.invoke: R|kotlin/Int|>|()).R|kotlin/Int.plus|(R|<local>/y|.R|SubstitutionOverride<kotlin/Function0.invoke: R|kotlin/Int|>|())
}