Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Parcelize value (inline) class in Kotlin

At first glance it seems to be okay to decorate a kotlin value (inline) class like that:

@JvmInline
@Parcelize
value class TestClass(val value: Long) : Parcelable

But the build fails reporting:

error: unexpected type
        public static final android.os.Parcelable.Creator<long> CREATOR = null;
                                                          ^
  required: reference
  found:    long

Is there a generic way to accomplish parcellation anyway?

like image 508
Casaflowa Avatar asked Oct 12 '25 10:10

Casaflowa


1 Answers

Uff, finally fixed in Kotlin 1.8.20-RC2.

like image 112
Miroslav Michalec Avatar answered Oct 15 '25 00:10

Miroslav Michalec