Files
Alexander Udalov 55f9f74d5c Tests: do not report backend diagnostics if there's frontend error
In most affected tests, the backend diagnostic such as "conflicting JVM
signature" or "accidental override" is directly caused by some already
existing error reported by frontend, so it doesn't make sense to check
backend diagnostics there.

Tests where that was not the case were moved/copied to
`testsWithJvmBackend`.
2024-03-13 08:38:15 +00:00

30 lines
1.0 KiB
Kotlin
Vendored

open class GenericBaseClass<T> {
open fun foo(x: T): T = x
open fun ambiguous(x: T): T = x
}
interface GenericBaseInterface<T> {
fun bar(x: T): T = x
fun ambiguous(x: T): T = x
}
class GenericDerivedClass<T> : GenericBaseClass<T>(), GenericBaseInterface<T> {
override fun foo(x: T): T = super.foo(x)
override fun bar(x: T): T = super.bar(x)
override fun ambiguous(x: T): T = foo(x)
}
<!CONFLICTING_INHERITED_JVM_DECLARATIONS!>class SpecializedDerivedClass : GenericBaseClass<Int>(), GenericBaseInterface<String> {
override fun foo(x: Int): Int = super.foo(x)
override fun bar(x: String): String = super.bar(x)
override fun ambiguous(x: String): String = bar(x)
override fun ambiguous(x: Int): Int = foo(x)
}<!>
class MixedDerivedClass<T> : GenericBaseClass<Int>(), GenericBaseInterface<T> {
override fun foo(x: Int): Int = super.foo(x)
override fun bar(x: T): T = super.bar(x)
override fun ambiguous(x: Int): Int = foo(x)
<!ACCIDENTAL_OVERRIDE!>override fun ambiguous(x: T): T = bar(x)<!>
}