[KxSerialization] Fix NPE when accessing delegated property

Kotlin 1.7.20 added optimizations for delegated properties on the JVM,
which broke serialization for optimized properties. Commit bfeff81
tried to fix that, but broke non-optimized delegated properties. This
commit restores correct serialization for optimized and non-optimized
properties, also ensuring that it only affects the JVM target.

 #KT-58954 Fixed
 #KT-59113 Fixed
This commit is contained in:
OliverO2
2023-06-02 16:23:06 +02:00
committed by Alexander Udalov
parent 733ca5a358
commit 027593cd78
6 changed files with 138 additions and 46 deletions
@@ -31,6 +31,12 @@ public class SerializationIrJsBoxTestGenerated extends AbstractSerializationIrJs
runTest("plugins/kotlinx-serialization/testData/boxIr/constValInSerialName.kt");
}
@Test
@TestMetadata("delegatedProperty.kt")
public void testDelegatedProperty() throws Exception {
runTest("plugins/kotlinx-serialization/testData/boxIr/delegatedProperty.kt");
}
@Test
@TestMetadata("excludedFromExport.kt")
public void testExcludedFromExport() throws Exception {