title: Making sealed class hierarchy Parcelable
body: <p>I have something similar like the following where I want to pass them around as intent arguments;</p>
  
  <pre><code>sealed class BasketType : Parcelable {
  
      class BasketOne(val basketId: String): BasketType() {
  
          constructor(parcel: Parcel) : this(parcel.readString()) {
          }
  
          override fun writeToParcel(parcel: Parcel, flags: Int) {
              super.writeToParcel(parcel, flags)
              parcel.writeString(basketId)
          }
  
          override fun describeContents(): Int {
              return 0
          }
  
          ...
      }
  
      ...
  }
  </code></pre>
  
  <p>But I get the following error;</p>
  
  <blockquote>
    <p>Abstract member cannot be accessed directly</p>
  </blockquote>
  
  <p>on the line <code>super.writeToParcel(parcel, flags)</code> which is kind of expected. </p>
  
  <p>I've looked around for a workaround but could not find one. Any ideas?</p>