Allow data classes to inherit from other classes
#KT-10330 Fixed
This commit is contained in:
@@ -1,11 +1,13 @@
|
||||
interface Allowed
|
||||
interface SuperInterface
|
||||
|
||||
open class NotAllowed
|
||||
open class SuperClass
|
||||
|
||||
<!INCOMPATIBLE_MODIFIERS!>abstract<!> <!INCOMPATIBLE_MODIFIERS!>data<!> class Base(val x: Int)
|
||||
|
||||
class Derived: Base(42)
|
||||
|
||||
<!DATA_CLASS_OVERRIDE_CONFLICT!>data<!> class Nasty(val z: Int, val y: Int): <!DATA_CLASS_CANNOT_HAVE_CLASS_SUPERTYPES!>Base<!>(z)
|
||||
<!DATA_CLASS_OVERRIDE_CONFLICT!>data<!> class Nasty(val z: Int, val y: Int): Base(z)
|
||||
|
||||
data class Complex(val y: Int): Allowed, <!DATA_CLASS_CANNOT_HAVE_CLASS_SUPERTYPES!>NotAllowed<!>()
|
||||
data class Complex(val y: Int): SuperInterface, SuperClass()
|
||||
|
||||
<!DATA_CLASS_OVERRIDE_CONFLICT!>data<!> class SubData(val sss: String) : <!FINAL_SUPERTYPE!>Complex<!>(42)
|
||||
|
||||
Reference in New Issue
Block a user