Do not assert existence of metadata for local delegated properties

Local delegated property may origin from a body of inlined function.
In that case, they contain no metatada - which is ok, as the original
local delegated properties contain it and will be serialized.

^KT-58780: Fixed
This commit is contained in:
vladislav.grechko
2023-06-09 14:37:23 +02:00
committed by Space Team
parent 4b85776405
commit d600d768a6
6 changed files with 2 additions and 7 deletions
@@ -54,8 +54,8 @@ fun makeFirMetadataSerializerForIrClass(
irActualizedResult: IrActualizedResult?
): FirMetadataSerializer {
val approximator = TypeApproximatorForMetadataSerializer(session)
val localDelegatedProperties = context.localDelegatedProperties[irClass.attributeOwnerId]?.map {
(it.owner.metadata as FirMetadataSource.Property).fir.copyToFreeProperty(approximator)
val localDelegatedProperties = context.localDelegatedProperties[irClass.attributeOwnerId]?.mapNotNull {
(it.owner.metadata as? FirMetadataSource.Property)?.fir?.copyToFreeProperty(approximator)
} ?: emptyList()
val firSerializerExtension = FirJvmSerializerExtension(
session, serializationBindings, context.state, irClass.metadata, localDelegatedProperties,
@@ -1,4 +1,3 @@
// IGNORE_INLINER_K2: IR
// FILE: 1.kt
package x
@@ -1,4 +1,3 @@
// IGNORE_INLINER_K2: IR
// FILE: 1.kt
package test
@@ -1,4 +1,3 @@
// IGNORE_INLINER_K2: IR
// IGNORE_BACKEND_MULTI_MODULE: JVM, JVM_MULTI_MODULE_IR_AGAINST_OLD
// FILE: test.kt
package test
@@ -1,4 +1,3 @@
// IGNORE_INLINER_K2: IR
// FILE: 1.kt
package test
@@ -1,4 +1,3 @@
// IGNORE_INLINER_K2: IR
// FILE: 1.kt
package test