Allow data classes to inherit from other classes

#KT-10330 Fixed
This commit is contained in:
Alexander Udalov
2016-06-20 16:45:28 +03:00
parent 065c4e19ec
commit e68de436bb
9 changed files with 109 additions and 20 deletions
@@ -0,0 +1,13 @@
// !LANGUAGE: -DataClassInheritance
interface Allowed
open class NotAllowed
<!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 Complex(val y: Int): Allowed, <!DATA_CLASS_CANNOT_HAVE_CLASS_SUPERTYPES!>NotAllowed<!>()