Join Slack
Powered by
can you add a secondary constructor to a data-clas...
# getting-started
t
tipsy
06/04/2017, 8:24 AM
can you add a secondary constructor to a data-class?
v
voddan
06/04/2017, 9:20 AM
tipsy: yes, why not. It has to delegate to the primary constructor, that's all
t
tipsy
06/04/2017, 10:19 AM
thanks,
j
j_kapp
06/04/2017, 10:43 AM
Not just possible, but actually necessary for Parcelable objects for Android. JetBrains even provide a plugin to do it automatically:
https://plugins.jetbrains.com/plugin/8086-parcelable-code-generator-for-kotlin-
4
Views
Open in Slack
Previous
Next