JVM_IR: skip SAM lambdas when computing enclosing method of objects

This is what Java 15+ does, and it permits accessing captured type
parameters via reflection. The alternative is to emit generic signatures
on the lambda methods, but that was disabled and I have no clue why.

^KT-52417 Fixed
This commit is contained in:
pyos
2022-05-24 09:23:41 +02:00
committed by Alexander Udalov
parent f81d47bad6
commit 27c51f5f88
21 changed files with 211 additions and 6 deletions
@@ -44391,6 +44391,12 @@ public class BlackBoxCodegenTestGenerated extends AbstractBlackBoxCodegenTest {
runTest("compiler/testData/codegen/box/sam/kt50171.kt");
}
@Test
@TestMetadata("kt52417.kt")
public void testKt52417() throws Exception {
runTest("compiler/testData/codegen/box/sam/kt52417.kt");
}
@Test
@TestMetadata("nonInlinedSamWrapper.kt")
public void testNonInlinedSamWrapper() throws Exception {
@@ -2230,6 +2230,12 @@ public class BlackBoxInlineCodegenTestGenerated extends AbstractBlackBoxInlineCo
runTest("compiler/testData/codegen/boxInline/enclosingInfo/inlineChain2.kt");
}
@Test
@TestMetadata("kt52417.kt")
public void testKt52417() throws Exception {
runTest("compiler/testData/codegen/boxInline/enclosingInfo/kt52417.kt");
}
@Test
@TestMetadata("objectInInlineFun.kt")
public void testObjectInInlineFun() throws Exception {
@@ -2230,6 +2230,12 @@ public class CompileKotlinAgainstInlineKotlinTestGenerated extends AbstractCompi
runTest("compiler/testData/codegen/boxInline/enclosingInfo/inlineChain2.kt");
}
@Test
@TestMetadata("kt52417.kt")
public void testKt52417() throws Exception {
runTest("compiler/testData/codegen/boxInline/enclosingInfo/kt52417.kt");
}
@Test
@TestMetadata("objectInInlineFun.kt")
public void testObjectInInlineFun() throws Exception {
@@ -44955,6 +44955,12 @@ public class IrBlackBoxCodegenTestGenerated extends AbstractIrBlackBoxCodegenTes
runTest("compiler/testData/codegen/box/sam/kt50477Enabled.kt");
}
@Test
@TestMetadata("kt52417.kt")
public void testKt52417() throws Exception {
runTest("compiler/testData/codegen/box/sam/kt52417.kt");
}
@Test
@TestMetadata("nonInlinedSamWrapper.kt")
public void testNonInlinedSamWrapper() throws Exception {
@@ -2230,6 +2230,12 @@ public class IrBlackBoxInlineCodegenTestGenerated extends AbstractIrBlackBoxInli
runTest("compiler/testData/codegen/boxInline/enclosingInfo/inlineChain2.kt");
}
@Test
@TestMetadata("kt52417.kt")
public void testKt52417() throws Exception {
runTest("compiler/testData/codegen/boxInline/enclosingInfo/kt52417.kt");
}
@Test
@TestMetadata("objectInInlineFun.kt")
public void testObjectInInlineFun() throws Exception {
@@ -2230,6 +2230,12 @@ public class IrCompileKotlinAgainstInlineKotlinTestGenerated extends AbstractIrC
runTest("compiler/testData/codegen/boxInline/enclosingInfo/inlineChain2.kt");
}
@Test
@TestMetadata("kt52417.kt")
public void testKt52417() throws Exception {
runTest("compiler/testData/codegen/boxInline/enclosingInfo/kt52417.kt");
}
@Test
@TestMetadata("objectInInlineFun.kt")
public void testObjectInInlineFun() throws Exception {
@@ -2230,6 +2230,12 @@ public class IrSerializeCompileKotlinAgainstInlineKotlinTestGenerated extends Ab
runTest("compiler/testData/codegen/boxInline/enclosingInfo/inlineChain2.kt");
}
@Test
@TestMetadata("kt52417.kt")
public void testKt52417() throws Exception {
runTest("compiler/testData/codegen/boxInline/enclosingInfo/kt52417.kt");
}
@Test
@TestMetadata("objectInInlineFun.kt")
public void testObjectInInlineFun() throws Exception {
@@ -2230,6 +2230,12 @@ public class JvmIrAgainstOldBoxInlineTestGenerated extends AbstractJvmIrAgainstO
runTest("compiler/testData/codegen/boxInline/enclosingInfo/inlineChain2.kt");
}
@Test
@TestMetadata("kt52417.kt")
public void testKt52417() throws Exception {
runTest("compiler/testData/codegen/boxInline/enclosingInfo/kt52417.kt");
}
@Test
@TestMetadata("objectInInlineFun.kt")
public void testObjectInInlineFun() throws Exception {
@@ -2230,6 +2230,12 @@ public class JvmOldAgainstIrBoxInlineTestGenerated extends AbstractJvmOldAgainst
runTest("compiler/testData/codegen/boxInline/enclosingInfo/inlineChain2.kt");
}
@Test
@TestMetadata("kt52417.kt")
public void testKt52417() throws Exception {
runTest("compiler/testData/codegen/boxInline/enclosingInfo/kt52417.kt");
}
@Test
@TestMetadata("objectInInlineFun.kt")
public void testObjectInInlineFun() throws Exception {