提交 ec1d42e9 编写于 作者: S Steven Schäfer 提交者: Alexander Udalov

JVM IR: Generate SAM wrapper classes as non-synthetic

上级 36711a76
......@@ -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
}
......
// 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
\ No newline at end of file
......@@ -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")
......
......@@ -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")
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册