JVM_IR indy-SAM: use '-Xsam-conversions=indy' if JVM 1.8+, LV 1.5+

This commit is contained in:
Dmitry Petrov
2021-03-10 09:39:35 +03:00
committed by TeamCityServer
parent bf844aa8e4
commit 00a335129b
7 changed files with 22 additions and 8 deletions
@@ -1,3 +1,4 @@
// SAM_CONVERSIONS: CLASS
// FILE: J.java
public class J {
@@ -1,3 +1,4 @@
// SAM_CONVERSIONS: CLASS
// This optimization is only done by the JVM_IR backend.
// IGNORE_BACKEND: JVM
// FILE: JFoo.java
@@ -17,7 +18,6 @@ fun test() {
JFoo.foo(A()::f)
}
// Referenced function called from run(), no wrapper class generated:
// 1 NEW A
// 2 NEW
// 0 INVOKEINTERFACE
@@ -25,5 +25,11 @@ inline fun inlineFun() {
// There should be no generic information in the SAM wrappers.
// 0 declaration: void <init>\(kotlin.jvm.functions.Function1<.*, .*>\)
// 0 declaration: function extends kotlin.jvm.functions.Function1<.*, .*>
// JVM_TEMPLATES
// 2 private final synthetic Lkotlin/jvm/functions/Function1; function
// 2 <init>\(Lkotlin/jvm/functions/Function1;\)V
// JVM_IR_TEMPLATES
// 1 private final synthetic Lkotlin/jvm/functions/Function1; function
// 1 <init>\(Lkotlin/jvm/functions/Function1;\)V