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`.
This commit is contained in:
Alexander Udalov
2024-03-11 22:22:03 +01:00
committed by Space Team
parent dca6c21d7f
commit 55f9f74d5c
38 changed files with 396 additions and 397 deletions
@@ -0,0 +1,54 @@
// !DIAGNOSTICS: -UNUSED_PARAMETER -INAPPLICABLE_JVM_NAME
// WITH_STDLIB
<!CONFLICTING_JVM_DECLARATIONS!>@JvmName("bar")
fun foo(a: Any) {}<!>
<!CONFLICTING_JVM_DECLARATIONS!>fun bar(a: Any) {}<!>
class C {
<!CONFLICTING_JVM_DECLARATIONS!>@JvmName("foo1")
fun foo(list: List<Int>) {}<!>
<!CONFLICTING_JVM_DECLARATIONS!>@JvmName("foo1")
fun foo(list: List<String>) {}<!>
}
// Conflicts in inheritance.
// A1 -> B1 with accidental override
open class A1 {
@JvmName("bar")
open fun foo() {}
}
class B1 : A1() {
<!ACCIDENTAL_OVERRIDE!>fun bar() {}<!>
}
// A2 -> B2 with intended override and conflicting JVM declarations
open class A2 {
@JvmName("bar")
open fun foo() {}
}
class B2 : A2() {
override fun foo() {}
<!ACCIDENTAL_OVERRIDE!>fun bar() {}<!>
}
// A3 -> B3 -> C3 with accidental override
open class A3 {
@JvmName("bar")
open fun foo() {}
}
open class B3: A3() {
}
class C3: B3() {
<!ACCIDENTAL_OVERRIDE!>fun bar() {}<!>
}
@@ -0,0 +1,54 @@
// !DIAGNOSTICS: -UNUSED_PARAMETER -INAPPLICABLE_JVM_NAME
// WITH_STDLIB
@JvmName("bar")
<!CONFLICTING_JVM_DECLARATIONS!>fun foo(a: Any) {}<!>
<!CONFLICTING_JVM_DECLARATIONS!>fun bar(a: Any) {}<!>
class C {
@JvmName("foo1")
<!CONFLICTING_JVM_DECLARATIONS!>fun foo(list: List<Int>) {}<!>
@JvmName("foo1")
<!CONFLICTING_JVM_DECLARATIONS!>fun foo(list: List<String>) {}<!>
}
// Conflicts in inheritance.
// A1 -> B1 with accidental override
open class A1 {
@JvmName("bar")
open fun foo() {}
}
class B1 : A1() {
<!ACCIDENTAL_OVERRIDE!>fun bar() {}<!>
}
// A2 -> B2 with intended override and conflicting JVM declarations
open class A2 {
@JvmName("bar")
open fun foo() {}
}
class B2 : A2() {
override fun foo() {}
<!ACCIDENTAL_OVERRIDE!>fun bar() {}<!>
}
// A3 -> B3 -> C3 with accidental override
open class A3 {
@JvmName("bar")
open fun foo() {}
}
open class B3: A3() {
}
class C3: B3() {
<!ACCIDENTAL_OVERRIDE!>fun bar() {}<!>
}