hi! I ran into an interesting problem when using k...
# serialization
w
hi! I ran into an interesting problem when using kotlinx serialization. I have an enum class in one file and a data class that serializes that enum class in another file (along with other fields) and i get an error during the build stage:
Symbol with IrConstructorSymbolImpl is unbound
I was wondering why this was the case as it worked before when the enum was in the same file as the data class and i found something interesting (will post text snippets in thread). If the enum class’s definition is commented out including an
@OptIn(ExperimentalSerializationApi::class)
(since I am using the
@JsonNames
annotation as well) in the same file as the data class, then the error does not appear. However, if I remove the
@OptIn(ExperimentalSerializationApi::class)
annotation, the error returns. I have two questions 1. Why must the enum’s definition be in the same file as the data class? 2. Why does commenting out the whole definition in the same file cause the error to go away? Thanks for any clarification and help in advance!
the command enum in its own file
the file with the data class (with the enum code commented out) this sent version of the file compiles fine if the opt in annotation is removed from the comment, the code will fail to build and give the IR error again
r
Looks like it's probably a compiler bug, I suggest reporting on youtrack
w
@rnett sorry to ping, but I do not see a youtrack for kotlinx.serialization. Would the alternative place to report be the issues tab on github?
r
It probably wouldn't hurt, but what I meant was https://youtrack.jetbrains.com/issues/KT. I don't know whether it's in the serialization plugin or the compiler core
w
I see, I’ll post to the issues tab and if they say its compiler core then I will post it as well to the youtrack, thanks for the info!