[Serialization] Workaround registering static writeSelf method in metadata
`IrGeneratedDeclarationsRegistrar` assumes that all generated functions are correct from a Kotlin point of view. But `writeSelf` method on JVM is a static method outside any object/companion object So to properly calculate containing class for this method we should generate a dispatch receiver parameter, register the method in metadata, and then remove the parameter (to make function static)
This commit is contained in:
+6
@@ -22,6 +22,12 @@ public class SerializationFirLightTreeBlackBoxTestGenerated extends AbstractSeri
|
||||
@TestMetadata("plugins/kotlinx-serialization/testData/boxIr")
|
||||
@TestDataPath("$PROJECT_ROOT")
|
||||
public class BoxIr {
|
||||
@Test
|
||||
@TestMetadata("allConstructorsAccessible.kt")
|
||||
public void testAllConstructorsAccessible() throws Exception {
|
||||
runTest("plugins/kotlinx-serialization/testData/boxIr/allConstructorsAccessible.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testAllFilesPresentInBoxIr() throws Exception {
|
||||
KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("plugins/kotlinx-serialization/testData/boxIr"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JVM_IR, true);
|
||||
|
||||
+6
@@ -20,6 +20,12 @@ import java.util.regex.Pattern;
|
||||
@TestMetadata("plugins/kotlinx-serialization/testData/boxIr")
|
||||
@TestDataPath("$PROJECT_ROOT")
|
||||
public class SerializationIrBoxTestGenerated extends AbstractSerializationIrBoxTest {
|
||||
@Test
|
||||
@TestMetadata("allConstructorsAccessible.kt")
|
||||
public void testAllConstructorsAccessible() throws Exception {
|
||||
runTest("plugins/kotlinx-serialization/testData/boxIr/allConstructorsAccessible.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testAllFilesPresentInBoxIr() throws Exception {
|
||||
KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("plugins/kotlinx-serialization/testData/boxIr"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JVM_IR, true);
|
||||
|
||||
Reference in New Issue
Block a user