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 Class Inheritance could lead to problems | 5 | 2113 | July 15, 2016 | |
|
What's a best way to inherit data class?
|
1 | 3785 | January 21, 2013 | |
| Data classes should be able to inherit from each other | 35 | 32198 | April 9, 2021 | |
| Data class inheritance | 13 | 27072 | April 15, 2023 | |
| Data class inheritance | 0 | 2439 | March 31, 2017 |