Files
kotlin-fork/compiler/testData/diagnostics/tests/sourceCompatibility/noDataClassInheritance.fir.kt
T
FenstonSingel b7d8e879a6 [FIR] Support 4 diagnostics for pairs of modifiers
In particular, this commit includes:
* Attempt to abstract access to FirSourceElement via FirModifier
* Add more visit functions to DeclarationCheckersDiagnosticComponent
* Add messages+factories for 4 modifier-related errors and warnings
* Introduce FirModifierChecker
2020-03-27 12:34:29 +03:00

24 lines
542 B
Kotlin
Vendored

// !LANGUAGE: -DataClassInheritance
interface Allowed
open class NotAllowed
<!INCOMPATIBLE_MODIFIERS!>abstract<!> <!INCOMPATIBLE_MODIFIERS!>data<!> class Base(val x: Int)
class Derived: Base(42)
data class Nasty(val z: Int, val y: Int): Base(z)
data class Complex(val y: Int): Allowed, NotAllowed()
interface AbstractEqualsHashCodeToString {
override fun equals(other: Any?): Boolean
override fun hashCode(): Int
override fun toString(): String
}
data class ImplInterface(val s: String) : AbstractEqualsHashCodeToString