You can inherit a data class from a non-data class. Inheriting a data class from another data class is not allowed because there is no way to make compiler-generated data class methods work consistently and intuitively in case of inheritance.
Related topics
Topic | Replies | Views | Activity | |
---|---|---|---|---|
Data classes should be able to inherit from each other | 35 | 31251 | April 9, 2021 | |
Data class inheritance | 0 | 2375 | March 31, 2017 | |
What's a best way to inherit data class?
|
1 | 3683 | January 21, 2013 | |
Data class inheritance | 13 | 23064 | April 15, 2023 | |
Hierarchy of data classes | 2 | 2596 | October 7, 2021 |