The following class fails with this error:
@Test
fun bug() {
XML.v1.encodeToString(
Bug.serializer(),
Bug(BugEnum.ABC, LocalDate.fromEpochDays(0))
)
}
@Serializable
data class Bug(
val enum: BugEnum,
@Contextual val date: LocalDate,
)
enum class BugEnum {
ABC,
}
illegal position for attribute
java.lang.IllegalStateException: illegal position for attribute
at nl.adaptivity.xmlutil.core.KtXmlWriter.attribute(KtXmlWriter.kt:574)
at nl.adaptivity.xmlutil.XmlWriterUtil__XmlWriterKt.writeAttribute(XmlWriter.kt:507)
at nl.adaptivity.xmlutil.XmlWriterUtil.writeAttribute(Unknown Source)
at nl.adaptivity.xmlutil.serialization.XmlEncoderBase.smartWriteAttribute(XMLEncoder.kt:975)
at nl.adaptivity.xmlutil.serialization.XmlEncoderBase.access$smartWriteAttribute(XMLEncoder.kt:33)
at nl.adaptivity.xmlutil.serialization.XmlEncoderBase$XmlEncoder.encodeString(XMLEncoder.kt:139)
at kotlinx.datetime.serializers.LocalDateSerializer.serialize(LocalDateSerializers.kt:124)
Versions:
Kotlin: 2.3.21
xmlutil: 1.0.0-rc2
The following class fails with this error:
Versions:
Kotlin: 2.3.21
xmlutil: 1.0.0-rc2