Psi2Ir: fix usage of flexible vararg type after approximation

This only affects JVM IR, and this is similar to how this was done in
the old JVM backend in `CallBasedArgumentGenerator.generateVararg`.

 #KT-52146 Fixed
This commit is contained in:
Alexander Udalov
2022-04-21 23:25:07 +02:00
parent 5450367e39
commit 24f3c7dc7d
7 changed files with 69 additions and 14 deletions
@@ -0,0 +1,27 @@
// TARGET_BACKEND: JVM
// FULL_JDK
// JVM_TARGET: 1.8
// FILE: J.java
import java.util.function.*;
public class J<SELF extends J<SELF, ACTUAL>, ACTUAL> {
public final SELF satisfies(Consumer<? super ACTUAL>... c) {
return null;
}
}
// FILE: box.kt
import java.util.function.*
fun test(j: J<*, *>) {
j.satisfies(Consumer { it is CharSequence })
j.satisfies({ it is CharSequence })
}
fun box(): String {
class K : J<K, String>()
test(K())
return "OK"
}