[FIR2IR] Properly insert casts for smartcasts in argument position

Previously cast inserter didn't consider expected type for arguments
  of function calls

^KT-63257 Fixed
This commit is contained in:
Dmitriy Novozhilov
2023-11-07 17:41:22 +02:00
committed by Space Team
parent c70a6425f5
commit 8578a0bf6a
30 changed files with 292 additions and 33 deletions
@@ -175,13 +175,13 @@ fun testSmartCastOnVarWithSuspendConversion(a: Any) {
fun testSmartCastVsSuspendConversion(a: Function0<Unit>) {
a as SuspendFunction0<Unit> /*~> Unit */
useSuspend(sfn = a)
useSuspend(sfn = a /*as SuspendFunction0<Unit> */)
}
fun testSmartCastOnVarVsSuspendConversion(a: Function0<Unit>) {
var b: Function0<Unit> = a
b as SuspendFunction0<Unit> /*~> Unit */
useSuspend(sfn = b)
useSuspend(sfn = b /*as SuspendFunction0<Unit> */)
}
fun <T> testIntersectionVsSuspendConversion(x: T) where T : Function0<Unit>, T : SuspendFunction0<Unit> {