[FIR2IR] Don't insert not-needed upcasts for smartcasted expressions

Related to KT-63257
This commit is contained in:
Dmitriy Novozhilov
2023-11-09 10:51:17 +02:00
committed by Space Team
parent aa1a997f8a
commit c70a6425f5
18 changed files with 55 additions and 62 deletions
@@ -175,13 +175,13 @@ fun testSmartCastOnVarWithSuspendConversion(a: Any) {
fun testSmartCastVsSuspendConversion(a: Function0<Unit>) {
a as SuspendFunction0<Unit> /*~> Unit */
useSuspend(sfn = a /*as Function<Unit> */)
useSuspend(sfn = a)
}
fun testSmartCastOnVarVsSuspendConversion(a: Function0<Unit>) {
var b: Function0<Unit> = a
b as SuspendFunction0<Unit> /*~> Unit */
useSuspend(sfn = b /*as Function<Unit> */)
useSuspend(sfn = b)
}
fun <T> testIntersectionVsSuspendConversion(x: T) where T : Function0<Unit>, T : SuspendFunction0<Unit> {