Do not create synthesized equals/hashCode/toString in data classes in compatibility mode
To simplify migration from 1.0 to 1.1, do not allow data classes to automatically implement abstract equals/hashCode/toString declared in super-interfaces (KT-11306) if "-language-version 1.0" is specified
This commit is contained in:
+10
@@ -11,3 +11,13 @@ 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<!>()
|
||||
|
||||
|
||||
|
||||
interface AbstractEqualsHashCodeToString {
|
||||
override fun equals(other: Any?): Boolean
|
||||
override fun hashCode(): Int
|
||||
override fun toString(): String
|
||||
}
|
||||
|
||||
data <!ABSTRACT_MEMBER_NOT_IMPLEMENTED!>class ImplInterface<!>(val s: String) : AbstractEqualsHashCodeToString
|
||||
|
||||
Reference in New Issue
Block a user