Skip to content

Delegate operator (by) produces nullpointer exeption on kotlin 1.8 #2157

@JochenGuckSnk

Description

@JochenGuckSnk

Describe the bug
after changing the project to kotlin version 1.8 a map delegate in a serializable class is no longer compiled.

Error:
Details: kotlinx.serialization compiler plugin internal error: unable to transform declaration, see cause
at org.jetbrains.kotlinx.serialization.compiler.extensions.SerializerClassLowering.lower(SerializationLoweringExtension.kt:184)
...
Caused by: java.lang.NullPointerException
at org.jetbrains.kotlinx.serialization.compiler.backend.ir.SerializableIrGenerator$generateInternalConstructor$1.invoke(SerializableIrGenerator.kt:137)

To Reproduce

@Serializable()
class Dto (
     val data: Map<Int, Int>
) : Map<Int, Int> by data

Expected behavior
It sould compile

Environment

  • Kotlin version: 1.8.0
  • Library version: 1.4.1
  • Kotlin platforms: Multiplatform
  • Gradle version: 7.4.2

MinimumExample.zip

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions