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
|
// !LANGUAGE: +NewCapturedReceiverFieldNamingConvention
|
||||||
// IR_DIFFERENCE
|
// IR_DIFFERENCE
|
||||||
// LOCAL_VARIABLE_TABLE
|
// LOCAL_VARIABLE_TABLE
|
||||||
|
// LAMBDAS: CLASS
|
||||||
|
|
||||||
fun String.foo(count: Int) {
|
fun String.foo(count: Int) {
|
||||||
val x = false
|
val x = false
|
||||||
|
|||||||
+1
@@ -1,6 +1,7 @@
|
|||||||
// !LANGUAGE: -NewCapturedReceiverFieldNamingConvention
|
// !LANGUAGE: -NewCapturedReceiverFieldNamingConvention
|
||||||
// IR_DIFFERENCE
|
// IR_DIFFERENCE
|
||||||
// LOCAL_VARIABLE_TABLE
|
// LOCAL_VARIABLE_TABLE
|
||||||
|
// LAMBDAS: CLASS
|
||||||
|
|
||||||
fun String.foo(count: Int) {
|
fun String.foo(count: Int) {
|
||||||
val x = false
|
val x = false
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
// !LANGUAGE: +NewCapturedReceiverFieldNamingConvention
|
// !LANGUAGE: +NewCapturedReceiverFieldNamingConvention
|
||||||
// IR_DIFFERENCE
|
// IR_DIFFERENCE
|
||||||
// LOCAL_VARIABLE_TABLE
|
// LOCAL_VARIABLE_TABLE
|
||||||
|
// LAMBDAS: CLASS
|
||||||
|
|
||||||
fun String.foo(count: Int) {
|
fun String.foo(count: Int) {
|
||||||
val x = false
|
val x = false
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
// !LANGUAGE: -NewCapturedReceiverFieldNamingConvention
|
// !LANGUAGE: -NewCapturedReceiverFieldNamingConvention
|
||||||
// IR_DIFFERENCE
|
// IR_DIFFERENCE
|
||||||
// LOCAL_VARIABLE_TABLE
|
// LOCAL_VARIABLE_TABLE
|
||||||
|
// LAMBDAS: CLASS
|
||||||
|
|
||||||
fun String.foo(count: Int) {
|
fun String.foo(count: Int) {
|
||||||
val x = false
|
val x = false
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
// IR_DIFFERENCE
|
// IR_DIFFERENCE
|
||||||
// LOCAL_VARIABLE_TABLE
|
// LOCAL_VARIABLE_TABLE
|
||||||
|
// LAMBDAS: CLASS
|
||||||
|
|
||||||
fun foo() {
|
fun foo() {
|
||||||
t { (`a b`, `b$c`, `c-d`, `b$$c--d`, `a()§&*&^@あ化`) -> }
|
t { (`a b`, `b$c`, `c-d`, `b$$c--d`, `a()§&*&^@あ化`) -> }
|
||||||
|
|||||||
+1
@@ -1,5 +1,6 @@
|
|||||||
// IR_DIFFERENCE
|
// IR_DIFFERENCE
|
||||||
// LOCAL_VARIABLE_TABLE
|
// LOCAL_VARIABLE_TABLE
|
||||||
|
// LAMBDAS: CLASS
|
||||||
|
|
||||||
fun String.foo(count: Int) {
|
fun String.foo(count: Int) {
|
||||||
val x = false
|
val x = false
|
||||||
|
|||||||
+1
@@ -1,6 +1,7 @@
|
|||||||
// !LANGUAGE: -NewCapturedReceiverFieldNamingConvention
|
// !LANGUAGE: -NewCapturedReceiverFieldNamingConvention
|
||||||
// IR_DIFFERENCE
|
// IR_DIFFERENCE
|
||||||
// LOCAL_VARIABLE_TABLE
|
// LOCAL_VARIABLE_TABLE
|
||||||
|
// LAMBDAS: CLASS
|
||||||
|
|
||||||
fun String.foo(count: Int) {
|
fun String.foo(count: Int) {
|
||||||
val x = false
|
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()
|
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 final class foo/Kotlin : java/lang/Object {
|
||||||
public void <init>()
|
public void <init>()
|
||||||
|
|
||||||
@@ -31,6 +45,8 @@ public final class foo/Kotlin : java/lang/Object {
|
|||||||
@Lfoo/TypeAnnBinary;([]) : METHOD_RETURN, null // invisible
|
@Lfoo/TypeAnnBinary;([]) : METHOD_RETURN, null // invisible
|
||||||
|
|
||||||
public final void foo5()
|
public final void foo5()
|
||||||
|
|
||||||
|
public final void foo6()
|
||||||
}
|
}
|
||||||
|
|
||||||
public abstract interface foo/TypeAnn : java/lang/Object, java/lang/annotation/Annotation {
|
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
|
@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 final class foo/Kotlin : java/lang/Object {
|
||||||
public void <init>()
|
public void <init>()
|
||||||
|
|
||||||
@@ -45,6 +59,8 @@ public final class foo/Kotlin : java/lang/Object {
|
|||||||
@Lfoo/TypeAnnBinary;([]) : METHOD_RETURN, null // invisible
|
@Lfoo/TypeAnnBinary;([]) : METHOD_RETURN, null // invisible
|
||||||
|
|
||||||
public final void foo5()
|
public final void foo5()
|
||||||
|
|
||||||
|
public final void foo6()
|
||||||
}
|
}
|
||||||
|
|
||||||
public abstract interface foo/TypeAnn : java/lang/Object, java/lang/annotation/Annotation {
|
public abstract interface foo/TypeAnn : java/lang/Object, java/lang/annotation/Annotation {
|
||||||
|
|||||||
@@ -3,6 +3,8 @@
|
|||||||
// RENDER_ANNOTATIONS
|
// RENDER_ANNOTATIONS
|
||||||
// TARGET_BACKEND: JVM
|
// TARGET_BACKEND: JVM
|
||||||
// JVM_TARGET: 1.8
|
// JVM_TARGET: 1.8
|
||||||
|
// WITH_STDLIB
|
||||||
|
|
||||||
package foo
|
package foo
|
||||||
|
|
||||||
@Target(AnnotationTarget.TYPE)
|
@Target(AnnotationTarget.TYPE)
|
||||||
@@ -27,7 +29,12 @@ class Kotlin {
|
|||||||
fun foo4() = { foo2() }()
|
fun foo4() = { foo2() }()
|
||||||
|
|
||||||
fun foo5() {
|
fun foo5() {
|
||||||
val lambda = { foo2() }
|
val lambda = @JvmSerializableLambda { foo2() }
|
||||||
lambda()
|
lambda()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
fun foo6() {
|
||||||
|
val indyLambda = { foo2() }
|
||||||
|
indyLambda()
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
+2
-7
@@ -1,12 +1,7 @@
|
|||||||
// IGNORE_BACKEND: WASM
|
// TARGET_BACKEND: JVM
|
||||||
// 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
|
|
||||||
// IGNORE_LIGHT_ANALYSIS
|
// IGNORE_LIGHT_ANALYSIS
|
||||||
|
|
||||||
// WITH_STDLIB
|
// WITH_STDLIB
|
||||||
|
// LAMBDAS: CLASS
|
||||||
|
|
||||||
import kotlin.test.assertEquals
|
import kotlin.test.assertEquals
|
||||||
import kotlin.jvm.internal.FunctionBase
|
import kotlin.jvm.internal.FunctionBase
|
||||||
|
|||||||
-6
@@ -2814,12 +2814,6 @@ public class JsCodegenBoxTestGenerated extends AbstractJsCodegenBoxTest {
|
|||||||
runTest("compiler/testData/codegen/box/callableReference/function/genericWithDependentType.kt");
|
runTest("compiler/testData/codegen/box/callableReference/function/genericWithDependentType.kt");
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
|
||||||
@TestMetadata("getArityViaFunctionImpl.kt")
|
|
||||||
public void testGetArityViaFunctionImpl() throws Exception {
|
|
||||||
runTest("compiler/testData/codegen/box/callableReference/function/getArityViaFunctionImpl.kt");
|
|
||||||
}
|
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
@TestMetadata("innerClassConstructorWithTwoReceivers.kt")
|
@TestMetadata("innerClassConstructorWithTwoReceivers.kt")
|
||||||
public void testInnerClassConstructorWithTwoReceivers() throws Exception {
|
public void testInnerClassConstructorWithTwoReceivers() throws Exception {
|
||||||
|
|||||||
-6
@@ -2868,12 +2868,6 @@ public class FirJsCodegenBoxTestGenerated extends AbstractFirJsCodegenBoxTest {
|
|||||||
runTest("compiler/testData/codegen/box/callableReference/function/genericWithDependentType.kt");
|
runTest("compiler/testData/codegen/box/callableReference/function/genericWithDependentType.kt");
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
|
||||||
@TestMetadata("getArityViaFunctionImpl.kt")
|
|
||||||
public void testGetArityViaFunctionImpl() throws Exception {
|
|
||||||
runTest("compiler/testData/codegen/box/callableReference/function/getArityViaFunctionImpl.kt");
|
|
||||||
}
|
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
@TestMetadata("innerClassConstructorWithTwoReceivers.kt")
|
@TestMetadata("innerClassConstructorWithTwoReceivers.kt")
|
||||||
public void testInnerClassConstructorWithTwoReceivers() throws Exception {
|
public void testInnerClassConstructorWithTwoReceivers() throws Exception {
|
||||||
|
|||||||
-6
@@ -2868,12 +2868,6 @@ public class IrJsCodegenBoxTestGenerated extends AbstractIrJsCodegenBoxTest {
|
|||||||
runTest("compiler/testData/codegen/box/callableReference/function/genericWithDependentType.kt");
|
runTest("compiler/testData/codegen/box/callableReference/function/genericWithDependentType.kt");
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
|
||||||
@TestMetadata("getArityViaFunctionImpl.kt")
|
|
||||||
public void testGetArityViaFunctionImpl() throws Exception {
|
|
||||||
runTest("compiler/testData/codegen/box/callableReference/function/getArityViaFunctionImpl.kt");
|
|
||||||
}
|
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
@TestMetadata("innerClassConstructorWithTwoReceivers.kt")
|
@TestMetadata("innerClassConstructorWithTwoReceivers.kt")
|
||||||
public void testInnerClassConstructorWithTwoReceivers() throws Exception {
|
public void testInnerClassConstructorWithTwoReceivers() throws Exception {
|
||||||
|
|||||||
-6
@@ -2868,12 +2868,6 @@ public class IrJsES6CodegenBoxTestGenerated extends AbstractIrJsES6CodegenBoxTes
|
|||||||
runTest("compiler/testData/codegen/box/callableReference/function/genericWithDependentType.kt");
|
runTest("compiler/testData/codegen/box/callableReference/function/genericWithDependentType.kt");
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
|
||||||
@TestMetadata("getArityViaFunctionImpl.kt")
|
|
||||||
public void testGetArityViaFunctionImpl() throws Exception {
|
|
||||||
runTest("compiler/testData/codegen/box/callableReference/function/getArityViaFunctionImpl.kt");
|
|
||||||
}
|
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
@TestMetadata("innerClassConstructorWithTwoReceivers.kt")
|
@TestMetadata("innerClassConstructorWithTwoReceivers.kt")
|
||||||
public void testInnerClassConstructorWithTwoReceivers() throws Exception {
|
public void testInnerClassConstructorWithTwoReceivers() throws Exception {
|
||||||
|
|||||||
-6
@@ -3003,12 +3003,6 @@ public class FirNativeCodegenBoxTestGenerated extends AbstractNativeCodegenBoxTe
|
|||||||
runTest("compiler/testData/codegen/box/callableReference/function/genericWithDependentType.kt");
|
runTest("compiler/testData/codegen/box/callableReference/function/genericWithDependentType.kt");
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
|
||||||
@TestMetadata("getArityViaFunctionImpl.kt")
|
|
||||||
public void testGetArityViaFunctionImpl() throws Exception {
|
|
||||||
runTest("compiler/testData/codegen/box/callableReference/function/getArityViaFunctionImpl.kt");
|
|
||||||
}
|
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
@TestMetadata("innerClassConstructorWithTwoReceivers.kt")
|
@TestMetadata("innerClassConstructorWithTwoReceivers.kt")
|
||||||
public void testInnerClassConstructorWithTwoReceivers() throws Exception {
|
public void testInnerClassConstructorWithTwoReceivers() throws Exception {
|
||||||
|
|||||||
-6
@@ -3073,12 +3073,6 @@ public class FirNativeCodegenBoxTestNoPLGenerated extends AbstractNativeCodegenB
|
|||||||
runTest("compiler/testData/codegen/box/callableReference/function/genericWithDependentType.kt");
|
runTest("compiler/testData/codegen/box/callableReference/function/genericWithDependentType.kt");
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
|
||||||
@TestMetadata("getArityViaFunctionImpl.kt")
|
|
||||||
public void testGetArityViaFunctionImpl() throws Exception {
|
|
||||||
runTest("compiler/testData/codegen/box/callableReference/function/getArityViaFunctionImpl.kt");
|
|
||||||
}
|
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
@TestMetadata("innerClassConstructorWithTwoReceivers.kt")
|
@TestMetadata("innerClassConstructorWithTwoReceivers.kt")
|
||||||
public void testInnerClassConstructorWithTwoReceivers() throws Exception {
|
public void testInnerClassConstructorWithTwoReceivers() throws Exception {
|
||||||
|
|||||||
-6
@@ -2968,12 +2968,6 @@ public class NativeCodegenBoxTestGenerated extends AbstractNativeCodegenBoxTest
|
|||||||
runTest("compiler/testData/codegen/box/callableReference/function/genericWithDependentType.kt");
|
runTest("compiler/testData/codegen/box/callableReference/function/genericWithDependentType.kt");
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
|
||||||
@TestMetadata("getArityViaFunctionImpl.kt")
|
|
||||||
public void testGetArityViaFunctionImpl() throws Exception {
|
|
||||||
runTest("compiler/testData/codegen/box/callableReference/function/getArityViaFunctionImpl.kt");
|
|
||||||
}
|
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
@TestMetadata("innerClassConstructorWithTwoReceivers.kt")
|
@TestMetadata("innerClassConstructorWithTwoReceivers.kt")
|
||||||
public void testInnerClassConstructorWithTwoReceivers() throws Exception {
|
public void testInnerClassConstructorWithTwoReceivers() throws Exception {
|
||||||
|
|||||||
-6
@@ -3038,12 +3038,6 @@ public class NativeCodegenBoxTestNoPLGenerated extends AbstractNativeCodegenBoxT
|
|||||||
runTest("compiler/testData/codegen/box/callableReference/function/genericWithDependentType.kt");
|
runTest("compiler/testData/codegen/box/callableReference/function/genericWithDependentType.kt");
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
|
||||||
@TestMetadata("getArityViaFunctionImpl.kt")
|
|
||||||
public void testGetArityViaFunctionImpl() throws Exception {
|
|
||||||
runTest("compiler/testData/codegen/box/callableReference/function/getArityViaFunctionImpl.kt");
|
|
||||||
}
|
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
@TestMetadata("innerClassConstructorWithTwoReceivers.kt")
|
@TestMetadata("innerClassConstructorWithTwoReceivers.kt")
|
||||||
public void testInnerClassConstructorWithTwoReceivers() throws Exception {
|
public void testInnerClassConstructorWithTwoReceivers() throws Exception {
|
||||||
|
|||||||
Generated
-5
@@ -2543,11 +2543,6 @@ public class IrCodegenBoxWasmTestGenerated extends AbstractIrCodegenBoxWasmTest
|
|||||||
runTest("compiler/testData/codegen/box/callableReference/function/genericWithDependentType.kt");
|
runTest("compiler/testData/codegen/box/callableReference/function/genericWithDependentType.kt");
|
||||||
}
|
}
|
||||||
|
|
||||||
@TestMetadata("getArityViaFunctionImpl.kt")
|
|
||||||
public void testGetArityViaFunctionImpl() throws Exception {
|
|
||||||
runTest("compiler/testData/codegen/box/callableReference/function/getArityViaFunctionImpl.kt");
|
|
||||||
}
|
|
||||||
|
|
||||||
@TestMetadata("innerClassConstructorWithTwoReceivers.kt")
|
@TestMetadata("innerClassConstructorWithTwoReceivers.kt")
|
||||||
public void testInnerClassConstructorWithTwoReceivers() throws Exception {
|
public void testInnerClassConstructorWithTwoReceivers() throws Exception {
|
||||||
runTest("compiler/testData/codegen/box/callableReference/function/innerClassConstructorWithTwoReceivers.kt");
|
runTest("compiler/testData/codegen/box/callableReference/function/innerClassConstructorWithTwoReceivers.kt");
|
||||||
|
|||||||
Reference in New Issue
Block a user