JVM IR: Generate SAM wrapper classes as non-synthetic
This commit is contained in:
committed by
Alexander Udalov
parent
36711a768b
commit
ec1d42e92b
Generated
+5
@@ -4338,6 +4338,11 @@ public class FirBytecodeTextTestGenerated extends AbstractFirBytecodeTextTest {
|
||||
public void testSamWrapperOfReference() throws Exception {
|
||||
runTest("compiler/testData/codegen/bytecodeText/sam/samWrapperOfReference.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("samWrapperSyntheticFlags.kt")
|
||||
public void testSamWrapperSyntheticFlags() throws Exception {
|
||||
runTest("compiler/testData/codegen/bytecodeText/sam/samWrapperSyntheticFlags.kt");
|
||||
}
|
||||
}
|
||||
|
||||
@TestMetadata("compiler/testData/codegen/bytecodeText/statements")
|
||||
|
||||
@@ -68,7 +68,7 @@ interface IrDeclarationOrigin {
|
||||
object ADAPTER_FOR_SUSPEND_CONVERSION : IrDeclarationOriginImpl("ADAPTER_FOR_SUSPEND_CONVERSION")
|
||||
object ADAPTER_PARAMETER_FOR_SUSPEND_CONVERSION : IrDeclarationOriginImpl("ADAPTER_PARAMETER_FOR_SUSPEND_CONVERSION")
|
||||
|
||||
object GENERATED_SAM_IMPLEMENTATION : IrDeclarationOriginImpl("GENERATED_SAM_IMPLEMENTATION", isSynthetic = true)
|
||||
object GENERATED_SAM_IMPLEMENTATION : IrDeclarationOriginImpl("GENERATED_SAM_IMPLEMENTATION")
|
||||
|
||||
val isSynthetic: Boolean get() = false
|
||||
}
|
||||
|
||||
@@ -0,0 +1,23 @@
|
||||
// FILE: J.java
|
||||
|
||||
public class J {
|
||||
public static void g(Runnable r) {
|
||||
r.run();
|
||||
}
|
||||
}
|
||||
|
||||
// FILE: test.kt
|
||||
|
||||
fun nonInlineFun() {
|
||||
val f = {}
|
||||
J.g(f)
|
||||
}
|
||||
|
||||
inline fun inlineFun() {
|
||||
val f = {}
|
||||
J.g(f)
|
||||
}
|
||||
|
||||
// 1 final class TestKt\$sam\$java_lang_Runnable\$0 implements java/lang/Runnable
|
||||
// 0 public final class TestKt\$sam\$java_lang_Runnable\$0 implements java/lang/Runnable
|
||||
// 1 public final class TestKt\$sam\$i\$java_lang_Runnable\$0 implements java/lang/Runnable
|
||||
@@ -4410,6 +4410,11 @@ public class BytecodeTextTestGenerated extends AbstractBytecodeTextTest {
|
||||
public void testSamWrapperOfReference() throws Exception {
|
||||
runTest("compiler/testData/codegen/bytecodeText/sam/samWrapperOfReference.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("samWrapperSyntheticFlags.kt")
|
||||
public void testSamWrapperSyntheticFlags() throws Exception {
|
||||
runTest("compiler/testData/codegen/bytecodeText/sam/samWrapperSyntheticFlags.kt");
|
||||
}
|
||||
}
|
||||
|
||||
@TestMetadata("compiler/testData/codegen/bytecodeText/statements")
|
||||
|
||||
+5
@@ -4338,6 +4338,11 @@ public class IrBytecodeTextTestGenerated extends AbstractIrBytecodeTextTest {
|
||||
public void testSamWrapperOfReference() throws Exception {
|
||||
runTest("compiler/testData/codegen/bytecodeText/sam/samWrapperOfReference.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("samWrapperSyntheticFlags.kt")
|
||||
public void testSamWrapperSyntheticFlags() throws Exception {
|
||||
runTest("compiler/testData/codegen/bytecodeText/sam/samWrapperSyntheticFlags.kt");
|
||||
}
|
||||
}
|
||||
|
||||
@TestMetadata("compiler/testData/codegen/bytecodeText/statements")
|
||||
|
||||
Reference in New Issue
Block a user