Support toString for AdaptedFunctionReference subclasses

Also make it serializable like other lambdas, suspend lambdas and normal
callable references.
This commit is contained in:
Alexander Udalov
2020-04-07 16:55:56 +02:00
parent fa879e667f
commit 9f758b4f25
9 changed files with 120 additions and 3 deletions
@@ -2110,6 +2110,11 @@ public class BlackBoxCodegenTestGenerated extends AbstractBlackBoxCodegenTest {
runTest("compiler/testData/codegen/box/callableReference/adaptedReferences/simpleEmptyVararg.kt");
}
@TestMetadata("toString.kt")
public void testToString() throws Exception {
runTest("compiler/testData/codegen/box/callableReference/adaptedReferences/toString.kt");
}
@TestMetadata("unboundReferences.kt")
public void testUnboundReferences() throws Exception {
runTest("compiler/testData/codegen/box/callableReference/adaptedReferences/unboundReferences.kt");
@@ -2937,6 +2942,11 @@ public class BlackBoxCodegenTestGenerated extends AbstractBlackBoxCodegenTest {
KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM, testDataFilePath);
}
@TestMetadata("adaptedReferences.kt")
public void testAdaptedReferences() throws Exception {
runTest("compiler/testData/codegen/box/callableReference/serializability/adaptedReferences.kt");
}
public void testAllFilesPresentInSerializability() throws Exception {
KotlinTestUtils.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/box/callableReference/serializability"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JVM, true);
}