[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:
committed by
Space Team
parent
c70a6425f5
commit
8578a0bf6a
Vendored
+4
-4
@@ -20,7 +20,7 @@ fun <T> test0(a: T) where T : KRunnable, T : Function0<Unit> {
|
||||
fun test1(a: Function0<Unit>) {
|
||||
when {
|
||||
a is KRunnable -> { // BLOCK
|
||||
run1(r = a)
|
||||
run1(r = a /*as KRunnable */)
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -33,7 +33,7 @@ fun test2(a: KRunnable) {
|
||||
fun test3(a: Function0<Unit>) {
|
||||
when {
|
||||
a is KRunnable -> { // BLOCK
|
||||
run2(r1 = a, r2 = a)
|
||||
run2(r1 = a /*as KRunnable */, r2 = a /*as KRunnable */)
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -41,7 +41,7 @@ fun test3(a: Function0<Unit>) {
|
||||
fun test4(a: Function0<Unit>, b: Function0<Unit>) {
|
||||
when {
|
||||
a is KRunnable -> { // BLOCK
|
||||
run2(r1 = a, r2 = b /*-> KRunnable */)
|
||||
run2(r1 = a /*as KRunnable */, r2 = b /*-> KRunnable */)
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -58,7 +58,7 @@ fun test5x(a: Any) {
|
||||
when {
|
||||
a is KRunnable -> { // BLOCK
|
||||
a /*as KRunnable */ as Function0<Unit> /*~> Unit */
|
||||
run1(r = a)
|
||||
run1(r = a /*as KRunnable */)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user