Works fine if you do this: val parcelList = Parc...
# announcements
Works fine if you do this: val parcelList = ParcelableUtils.createBooleanArrayList(parcel) as ArrayList<Boolean?> to force it, but the IDE thinks that the stuff on the right is a useless cast.
you can do
val parcelList : ArrayList<Boolean?> = ParcelableUtils.createBooleanArrayList(parcel)
all in all, this is a long standing discussion. during development kotlin used to infer all java declarations as nullable by default. this caused so much pain (null checks,
everywhere) that the team decided to rvert this and introduced platform types
which means "I don't know if this is nullable or not, you decide". like everything in language design, it's a trade-off.
ahhh...I missed that discussion. Thanks ­čÖé Oddly, I prefer the "As" syntax because it reminds me of C#. The other way gets rid of the IDE warning though.