[FIR] Remove the redundant isFunctionType check

^KT-63865 fixed
This commit is contained in:
Nikita Nazarov
2023-12-01 11:38:55 +01:00
committed by Space Team
parent 3a77f39199
commit 1df318ff28
7 changed files with 46 additions and 1 deletions
@@ -0,0 +1,12 @@
FILE: castForFunctionsWithDifferentArities.kt
public final fun test(b: R|kotlin/Boolean|, block1: R|kotlin/Any.() -> kotlin/Unit|, block2: R|(kotlin/Any.(kotlin/Any?) -> kotlin/Unit)?|): R|kotlin/Unit| {
when () {
R|<local>/b| -> {
R|kotlin/requireNotNull|<R|kotlin/Any.() -> kotlin/Unit|>(R|<local>/block1|)
}
else -> {
R|kotlin/requireNotNull|<R|kotlin/Any.(kotlin/Any?) -> kotlin/Unit|>(R|<local>/block2|)
}
}
}
@@ -0,0 +1,9 @@
// ISSUE: KT-63865
fun test(b: Boolean, block1: Any.() -> Unit, block2: (Any.(Any?) -> Unit)?) {
if (b) {
requireNotNull(block1)
} else {
requireNotNull(block2)
}
}