4

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?

Casaflowa
  • 43
  • 4

2 Answers2

3

Uff, finally fixed in Kotlin 1.8.20-RC2.

Miroslav Michalec
  • 1,569
  • 1
  • 19
  • 22
2

This was reported as an issue for inline classes on youtrack and then moved to issuertracker on google

That said, I just tried and am not getting any build errors, with compileSDK 31 and kotlin 1.5.3

Dmitri
  • 2,563
  • 1
  • 22
  • 30