https://kotlinlang.org logo
#android
Title
# android
p

Paul Woitaschek

08/10/2018, 8:52 AM
I would like the compiler to throw an error if Parcelize wants to serialize
Serializable
classes. Is that possible? I want to enforce
Parceler
for every type
l

louiscad

08/10/2018, 10:43 AM
You can perfectly implement
Serializable
so that it is more efficient than
Parcelable
(e.g. by not relying on reflection and implementing the private methods), so it doesn't make so much sense IMHO. Maybe in the future, when there is support for compiler plugins, you'll be able to do this, or maybe you can already do this using a custom annotation processor or a gradle plugin