JVM IR: disable SAM conversion in case type has 'in' projection
... and the corresponding type parameter has a non-trivial (i.e. non-`Any?`) upper bound. The best solution here would be to get rid of `removeExternalProjections` completely, and just use the type of the argument at the call site, but see KT-52428. #KT-51868 Fixed
This commit is contained in:
Vendored
+6
-1
@@ -1,10 +1,15 @@
|
||||
// IGNORE_BACKEND_FIR: JVM_IR
|
||||
// FIR status: the test passes but LambdaMetafactory is used, so bytecode text check fails.
|
||||
// In this case FIR behavior is fine but it works because of a hack in
|
||||
|
||||
// TARGET_BACKEND: JVM
|
||||
// JVM_TARGET: 1.8
|
||||
// SAM_CONVERSIONS: INDY
|
||||
|
||||
// CHECK_BYTECODE_TEXT
|
||||
// JVM_IR_TEMPLATES
|
||||
// 1 java/lang/invoke/LambdaMetafactory
|
||||
// 0 java/lang/invoke/LambdaMetafactory
|
||||
// TODO: restore indy for SAM types with contravariant projections. See KT-52428 for more info.
|
||||
|
||||
fun interface Cmp<T> {
|
||||
fun compare(a: T, b: T): Int
|
||||
|
||||
Reference in New Issue
Block a user