title: Kotlin : Inheritance and issue with parcelable data
body: <p>I am trying to get my head around an issue and i couldn't find any particular solution.</p>
  
  <p>Base Class </p>
  
  <pre><code>open class FeedBase() : Parcelable{
  
  var type : String =""
  
  constructor(parcel: Parcel) : this() {
      type=parcel.readString()
  }
  
  override fun writeToParcel(parcel: Parcel, flags: Int) {
      parcel.writeString(type)
  }
  
  override fun describeContents(): Int {
      return 0
  }
  
  companion object CREATOR: Parcelable.Creator&lt;FeedBase&gt; {
      override fun createFromParcel(parcel: Parcel): FeedBase {
          return FeedBase(parcel)
      }
  
      override fun newArray(size: Int): Array&lt;FeedBase?&gt; {
          return arrayOfNulls(size)
      }
  }}
  </code></pre>
  
  <p>Item Class holding data class &amp; extending Base class</p>
  
  <pre><code>@Parcelize
  data class FeedItem(var feed:Feed) : FeedBase()
  </code></pre>
  
  <p>&amp; Data class</p>
  
  <pre><code>@Parcelize
  data class Feed(var test:String,var score:Int) : Parcelable
  </code></pre>
  
  <p>Now I am trying to send my data across activities and I am creating my object like below </p>
  
  <pre><code>val feedItem = FeedItem(Feed("yolo", 1000))
  feedItem.type="test"
  </code></pre>
  
  <p>but I am not able to get the correct <strong>type</strong>(var in Base class). It gets empty whenever I receive the object from parcelable intent in another activity but Item data is preserved. How can I resolve this?</p>