JVM: prepare asmLike tests for indy lambdas by default
Use -Xlambdas=class in tests which were checking specific things related to how anonymous classes for lambdas work (such as receiver mangling, function arity etc.)
This commit is contained in:
committed by
Space Team
parent
4c4afbd646
commit
163afc94bc
+1
@@ -1,6 +1,7 @@
|
||||
// !LANGUAGE: +NewCapturedReceiverFieldNamingConvention
|
||||
// IR_DIFFERENCE
|
||||
// LOCAL_VARIABLE_TABLE
|
||||
// LAMBDAS: CLASS
|
||||
|
||||
fun String.foo(count: Int) {
|
||||
val x = false
|
||||
|
||||
+1
@@ -1,6 +1,7 @@
|
||||
// !LANGUAGE: -NewCapturedReceiverFieldNamingConvention
|
||||
// IR_DIFFERENCE
|
||||
// LOCAL_VARIABLE_TABLE
|
||||
// LAMBDAS: CLASS
|
||||
|
||||
fun String.foo(count: Int) {
|
||||
val x = false
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
// !LANGUAGE: +NewCapturedReceiverFieldNamingConvention
|
||||
// IR_DIFFERENCE
|
||||
// LOCAL_VARIABLE_TABLE
|
||||
// LAMBDAS: CLASS
|
||||
|
||||
fun String.foo(count: Int) {
|
||||
val x = false
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
// !LANGUAGE: -NewCapturedReceiverFieldNamingConvention
|
||||
// IR_DIFFERENCE
|
||||
// LOCAL_VARIABLE_TABLE
|
||||
// LAMBDAS: CLASS
|
||||
|
||||
fun String.foo(count: Int) {
|
||||
val x = false
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
// IR_DIFFERENCE
|
||||
// LOCAL_VARIABLE_TABLE
|
||||
// LAMBDAS: CLASS
|
||||
|
||||
fun foo() {
|
||||
t { (`a b`, `b$c`, `c-d`, `b$$c--d`, `a()§&*&^@あ化`) -> }
|
||||
|
||||
+1
@@ -1,5 +1,6 @@
|
||||
// IR_DIFFERENCE
|
||||
// LOCAL_VARIABLE_TABLE
|
||||
// LAMBDAS: CLASS
|
||||
|
||||
fun String.foo(count: Int) {
|
||||
val x = false
|
||||
|
||||
+1
@@ -1,6 +1,7 @@
|
||||
// !LANGUAGE: -NewCapturedReceiverFieldNamingConvention
|
||||
// IR_DIFFERENCE
|
||||
// LOCAL_VARIABLE_TABLE
|
||||
// LAMBDAS: CLASS
|
||||
|
||||
fun String.foo(count: Int) {
|
||||
val x = false
|
||||
|
||||
@@ -12,6 +12,20 @@ final class foo/Kotlin$foo5$lambda$1 : kotlin/jvm/internal/Lambda, kotlin/jvm/fu
|
||||
public java.lang.Object invoke()
|
||||
}
|
||||
|
||||
Lkotlin/jvm/internal/Lambda;Lkotlin/jvm/functions/Function0<Ljava/lang/String;>;
|
||||
final class foo/Kotlin$foo6$indyLambda$1 : kotlin/jvm/internal/Lambda, kotlin/jvm/functions/Function0 {
|
||||
final foo.Kotlin this$0
|
||||
|
||||
void <init>(foo.Kotlin $receiver)
|
||||
|
||||
public final java.lang.String invoke()
|
||||
@Lorg/jetbrains/annotations/NotNull;([]) // invisible
|
||||
@Lfoo/TypeAnn;([name="2"]) : METHOD_RETURN, null
|
||||
@Lfoo/TypeAnnBinary;([]) : METHOD_RETURN, null // invisible
|
||||
|
||||
public java.lang.Object invoke()
|
||||
}
|
||||
|
||||
public final class foo/Kotlin : java/lang/Object {
|
||||
public void <init>()
|
||||
|
||||
@@ -31,6 +45,8 @@ public final class foo/Kotlin : java/lang/Object {
|
||||
@Lfoo/TypeAnnBinary;([]) : METHOD_RETURN, null // invisible
|
||||
|
||||
public final void foo5()
|
||||
|
||||
public final void foo6()
|
||||
}
|
||||
|
||||
public abstract interface foo/TypeAnn : java/lang/Object, java/lang/annotation/Annotation {
|
||||
|
||||
@@ -26,6 +26,20 @@ final class foo/Kotlin$foo5$lambda$1 : kotlin/jvm/internal/Lambda, kotlin/jvm/fu
|
||||
@Lfoo/TypeAnnBinary;([]) : METHOD_RETURN, null // invisible
|
||||
}
|
||||
|
||||
Lkotlin/jvm/internal/Lambda;Lkotlin/jvm/functions/Function0<Ljava/lang/String;>;
|
||||
final class foo/Kotlin$foo6$indyLambda$1 : kotlin/jvm/internal/Lambda, kotlin/jvm/functions/Function0 {
|
||||
final foo.Kotlin this$0
|
||||
|
||||
void <init>(foo.Kotlin p0)
|
||||
|
||||
public java.lang.Object invoke()
|
||||
|
||||
public final java.lang.String invoke()
|
||||
@Lorg/jetbrains/annotations/NotNull;([]) // invisible
|
||||
@Lfoo/TypeAnn;([name="2"]) : METHOD_RETURN, null
|
||||
@Lfoo/TypeAnnBinary;([]) : METHOD_RETURN, null // invisible
|
||||
}
|
||||
|
||||
public final class foo/Kotlin : java/lang/Object {
|
||||
public void <init>()
|
||||
|
||||
@@ -45,6 +59,8 @@ public final class foo/Kotlin : java/lang/Object {
|
||||
@Lfoo/TypeAnnBinary;([]) : METHOD_RETURN, null // invisible
|
||||
|
||||
public final void foo5()
|
||||
|
||||
public final void foo6()
|
||||
}
|
||||
|
||||
public abstract interface foo/TypeAnn : java/lang/Object, java/lang/annotation/Annotation {
|
||||
|
||||
@@ -3,6 +3,8 @@
|
||||
// RENDER_ANNOTATIONS
|
||||
// TARGET_BACKEND: JVM
|
||||
// JVM_TARGET: 1.8
|
||||
// WITH_STDLIB
|
||||
|
||||
package foo
|
||||
|
||||
@Target(AnnotationTarget.TYPE)
|
||||
@@ -27,7 +29,12 @@ class Kotlin {
|
||||
fun foo4() = { foo2() }()
|
||||
|
||||
fun foo5() {
|
||||
val lambda = { foo2() }
|
||||
val lambda = @JvmSerializableLambda { foo2() }
|
||||
lambda()
|
||||
}
|
||||
|
||||
fun foo6() {
|
||||
val indyLambda = { foo2() }
|
||||
indyLambda()
|
||||
}
|
||||
}
|
||||
|
||||
+2
-7
@@ -1,12 +1,7 @@
|
||||
// IGNORE_BACKEND: WASM
|
||||
// WASM_MUTE_REASON: IGNORED_IN_JS
|
||||
// IGNORE_BACKEND: JS_IR
|
||||
// IGNORE_BACKEND: JS_IR_ES6
|
||||
// TODO: muted automatically, investigate should it be ran for JS or not
|
||||
// IGNORE_BACKEND: JS, NATIVE
|
||||
// TARGET_BACKEND: JVM
|
||||
// IGNORE_LIGHT_ANALYSIS
|
||||
|
||||
// WITH_STDLIB
|
||||
// LAMBDAS: CLASS
|
||||
|
||||
import kotlin.test.assertEquals
|
||||
import kotlin.jvm.internal.FunctionBase
|
||||
|
||||
Reference in New Issue
Block a user