JVM_IR Do not generate generic signatures for lifted lambda methods

This commit is contained in:
Dmitry Petrov
2021-03-10 09:45:34 +03:00
committed by TeamCityServer
parent 00a335129b
commit 737fbe271f
14 changed files with 129 additions and 27 deletions
@@ -19945,6 +19945,12 @@ public class BlackBoxCodegenTestGenerated extends AbstractBlackBoxCodegenTest {
runTest("compiler/testData/codegen/box/invokedynamic/lambdas/extensionLambda.kt");
}
@Test
@TestMetadata("genericLambdaSignature.kt")
public void testGenericLambdaSignature() throws Exception {
runTest("compiler/testData/codegen/box/invokedynamic/lambdas/genericLambdaSignature.kt");
}
@Test
@TestMetadata("lambdaSerializable.kt")
public void testLambdaSerializable() throws Exception {
@@ -20127,6 +20133,12 @@ public class BlackBoxCodegenTestGenerated extends AbstractBlackBoxCodegenTest {
runTest("compiler/testData/codegen/box/invokedynamic/sam/genericFunInterfaceWithPrimitive.kt");
}
@Test
@TestMetadata("genericLambdaSignature.kt")
public void testGenericLambdaSignature() throws Exception {
runTest("compiler/testData/codegen/box/invokedynamic/sam/genericLambdaSignature.kt");
}
@Test
@TestMetadata("intReturnTypeAsNumber.kt")
public void testIntReturnTypeAsNumber() throws Exception {
@@ -19945,6 +19945,12 @@ public class IrBlackBoxCodegenTestGenerated extends AbstractIrBlackBoxCodegenTes
runTest("compiler/testData/codegen/box/invokedynamic/lambdas/extensionLambda.kt");
}
@Test
@TestMetadata("genericLambdaSignature.kt")
public void testGenericLambdaSignature() throws Exception {
runTest("compiler/testData/codegen/box/invokedynamic/lambdas/genericLambdaSignature.kt");
}
@Test
@TestMetadata("lambdaSerializable.kt")
public void testLambdaSerializable() throws Exception {
@@ -20127,6 +20133,12 @@ public class IrBlackBoxCodegenTestGenerated extends AbstractIrBlackBoxCodegenTes
runTest("compiler/testData/codegen/box/invokedynamic/sam/genericFunInterfaceWithPrimitive.kt");
}
@Test
@TestMetadata("genericLambdaSignature.kt")
public void testGenericLambdaSignature() throws Exception {
runTest("compiler/testData/codegen/box/invokedynamic/sam/genericLambdaSignature.kt");
}
@Test
@TestMetadata("intReturnTypeAsNumber.kt")
public void testIntReturnTypeAsNumber() throws Exception {
@@ -8,6 +8,7 @@ package org.jetbrains.kotlin.test.backend.handlers
import org.jetbrains.kotlin.codegen.BytecodeListingTextCollectingVisitor
import org.jetbrains.kotlin.test.directives.CodegenTestDirectives
import org.jetbrains.kotlin.test.directives.CodegenTestDirectives.CHECK_BYTECODE_LISTING
import org.jetbrains.kotlin.test.directives.CodegenTestDirectives.WITH_SIGNATURES
import org.jetbrains.kotlin.test.directives.model.DirectivesContainer
import org.jetbrains.kotlin.test.model.BinaryArtifacts
import org.jetbrains.kotlin.test.model.TestModule
@@ -27,10 +28,10 @@ class BytecodeListingHandler(testServices: TestServices) : JvmBinaryArtifactHand
if (CHECK_BYTECODE_LISTING !in module.directives) return
val dump = BytecodeListingTextCollectingVisitor.getText(
info.classFileFactory,
BytecodeListingTextCollectingVisitor.Filter.ForCodegenTests
BytecodeListingTextCollectingVisitor.Filter.ForCodegenTests,
withSignatures = WITH_SIGNATURES in module.directives
)
multiModuleInfoDumper.builderForModule(module).append(dump)
}
override fun processAfterAllModules(someAssertionWasFailed: Boolean) {
@@ -48,7 +48,12 @@ object CodegenTestDirectives : SimpleDirectivesContainer() {
)
val CHECK_BYTECODE_LISTING by directive(
description = "Dump resulting bytecode to .txt or _ir.txt file",
description = "Dump generated classes to .txt or _ir.txt file",
applicability = Global
)
val WITH_SIGNATURES by directive(
description = "Include generic signatures in generated classes dump",
applicability = Global
)