pdvrieze / xmlutil

XML Serialization library for Kotlin
https://pdvrieze.github.io/xmlutil/
Apache License 2.0
363 stars 30 forks source link

`XmlDeclMode` is internal in v0.90.1 #219

Open FooIbar opened 3 weeks ago

FooIbar commented 3 weeks ago

https://github.com/pdvrieze/xmlutil/blob/805e46d990560147ab1d7e087aa8527a8bf92991/core/base/src/commonMain/kotlin/nl/adaptivity/xmlutil/XmlStreaming.kt#L121-L122 This annotation essentially makes XmlDeclMode internal, see https://github.com/FooIbar/EhViewer/actions/runs/9536087101/job/26282595055

pdvrieze commented 3 weeks ago

This is strange as you only access the enum constants. They should not be part of the companion. I'll undo it in the next release. For this one, opting in is probably the best workaround.

FooIbar commented 3 weeks ago

This might be a bug of the K2 compiler. It compiles successfully if I change the language version to 1.9.

pdvrieze commented 3 weeks ago

@FooIbar It probably is. The companion object was marked as internal as it is only there as implementation detail (to hold the "from" function, which is only there to support the compatibility configuration). The enum constants are not internal.

pdvrieze commented 3 weeks ago

I've filed a bug on youtrack: https://youtrack.jetbrains.com/issue/KT-69182/K2-regression-optin-on-enum-companion-blocks-enum-constants