Handle situation where KSerializer is absent from immediate supertypes

of the class used in @UseSerializers: Use methods to receive
full list of supertypes.

K1 supertypes() call returned all supertypes, while
IrClass.supertypes and FirClassSymbol.resolvedSuperTypes return only immediate ones.

This lead to a difference in behavior between K1 and K2, and regression
after plugin backend was rewritten from descriptors to IR.

#KT-55340 Fixed
This commit is contained in:
Leonid Startsev
2022-12-07 13:57:19 +01:00
committed by Space Team
parent c011f0c374
commit 1c4614e93b
7 changed files with 98 additions and 9 deletions
@@ -134,6 +134,12 @@ public class SerializationFirBlackBoxTestGenerated extends AbstractSerialization
public void testTypealiasesTest() throws Exception {
runTest("plugins/kotlinx-serialization/testData/boxIr/typealiasesTest.kt");
}
@Test
@TestMetadata("useSerializersChain.kt")
public void testUseSerializersChain() throws Exception {
runTest("plugins/kotlinx-serialization/testData/boxIr/useSerializersChain.kt");
}
}
@Nested
@@ -132,4 +132,10 @@ public class SerializationIrBoxTestGenerated extends AbstractSerializationIrBoxT
public void testTypealiasesTest() throws Exception {
runTest("plugins/kotlinx-serialization/testData/boxIr/typealiasesTest.kt");
}
@Test
@TestMetadata("useSerializersChain.kt")
public void testUseSerializersChain() throws Exception {
runTest("plugins/kotlinx-serialization/testData/boxIr/useSerializersChain.kt");
}
}