Not 100% sure this is related to Essenty, but I th...
# decompose
a
Not 100% sure this is related to Essenty, but I think it is: I'm getting a Kotlin compiler crash after upgrading to Decompose 2.1.0 & Kotlin 1.9.0 And adding the
parcelize-darwin
plugin:
Copy code
error: Compilation failed: Back-end: Please report this problem <https://kotl.in/issue>
/Users/runner/work/hammer-editor/hammer-editor/common/src/commonMain/kotlin/com/darkrockstudios/apps/hammer/common/components/projectselection/projectslist/ProjectsList.kt:-1:-1
Details: Internal error in file lowering: java.lang.IllegalStateException: Error generating encode statement for FIELD PROPERTY_BACKING_FIELD name:toast type:dev.icerock.moko.resources.StringResource? visibility:private [final] of CLASS CLASS name:State modality:FINAL visibility:public [data] superTypes:[com.arkivanov.parcelize.darwin.Parcelable{ com.arkivanov.essenty.parcelable.Parcelable }]

...

 Caused by: java.lang.IllegalStateException: Error generating encode statement for FIELD PROPERTY_BACKING_FIELD name:toast type:dev.icerock.moko.resources.StringResource? visibility:private [final] of CLASS CLASS name:State modality:FINAL visibility:public [data] superTypes:[com.arkivanov.parcelize.darwin.Parcelable{ com.arkivanov.essenty.parcelable.Parcelable }]
This looks like the file in question: https://github.com/Wavesonics/hammer-editor/blob/develop/common/src/commonMain/kot[…]common/components/projectselection/projectslist/ProjectsList.kt
oh interesting, it was because there was a member of that data class that was not parcelizable. Interesting though, I added an
@TypeParcelizer
for that type, and it didn't fix it
a
Can you provide a full stack trace? The error says
toast
property is of type
StringResource
, but in the code it's String. Also please try updating Essenty to at least 1.2.0-alpha-05 and
parcelize-darwin
plugin to at least 0.1.5.
a
it wasn't a string, it was a moko
StringResource
previously, I just changed it to resolve the compiler crash: https://github.com/Wavesonics/hammer-editor/commit/31385a34d04dd114a308d4e90572287bd6ab91b8#diff-632a3c5513eb91b6728a5[…]5fe92684bfccd218fbb6ee44L41
these are my current library versions:
Copy code
decompose = "2.1.0-alpha-07"
essenty = "1.2.0-alpha-06"
parcelize_darwin = "0.2.0"
a
Ok so it was
StringResource
with
TypeParceler
annotation. Please see https://github.com/arkivanov/Essenty#custom-parcelers
Hmm, I can see that you also have a Parceler for Instant type and I assume that works fine. So that might be something specific to the StringResource type. Wondering, how is it defined?
a
yep that's the one. yeah I'll get a full log after work tonight
👍 1
a
Thanks! For some reason, the plugin doesn't detect the
TypeParceler
annotation. Would be helpful to have a reproducer.
Could you please try changing the type from
StringResource?
to
StringResource
and see if it works this way?
If it is, I will fix the issue.
a
yup, that fixes it!
a
Thanks! This is a bug in the plugin.