Tests: do not report backend diagnostics in diagnostic tests

There's a separate test data directory `testsWithJvmBackend` with a
runner that properly invokes the JVM backend and reports diagnostics
from it. All tests where JVM diagnostic presence/absence is important
were copied/moved there in this and previous commits.

The problem with the code removed in this commit is that it invoked some
parts of the _old JVM backend_ and old light classes, which is very far
from what users see in the production compiler at this point. This led
to real issues where we implemented incorrect behavior in K2 based on
the misleading diagnostic report from the K1 test.

The diagnostic in `triangleWithFlexibleTypeAndSubstitution4.kt` was
removed, but there's a copy of this test in `codegen/box/javaInterop`
which fails for K2 (KT-66529).

The diagnostic in `intersectionWithMappedSignature.kt` was removed and
that is OK because at this point CONFLICTING_JVM_DECLARATIONS there
seems like a bug in the old JVM backend.
This commit is contained in:
Alexander Udalov
2024-03-12 11:40:06 +01:00
committed by Space Team
parent 7d6cd8d126
commit 324d2e042a
9 changed files with 5 additions and 92 deletions
@@ -11,7 +11,6 @@ import org.jetbrains.kotlin.test.builders.TestConfigurationBuilder
import org.jetbrains.kotlin.test.builders.classicFrontendHandlersStep
import org.jetbrains.kotlin.test.builders.classicFrontendStep
import org.jetbrains.kotlin.test.directives.DiagnosticsDirectives.DIAGNOSTICS
import org.jetbrains.kotlin.test.directives.DiagnosticsDirectives.REPORT_JVM_DIAGNOSTICS_ON_FRONTEND
import org.jetbrains.kotlin.test.directives.JvmEnvironmentConfigurationDirectives.USE_PSI_CLASS_FILES_READING
import org.jetbrains.kotlin.test.frontend.classic.ClassicFrontendFailingTestSuppressor
import org.jetbrains.kotlin.test.frontend.classic.handlers.ClassicDiagnosticsHandler
@@ -32,7 +31,6 @@ abstract class AbstractParcelizeDiagnosticTest : AbstractKotlinCompilerTest() {
defaultDirectives {
+USE_PSI_CLASS_FILES_READING
+REPORT_JVM_DIAGNOSTICS_ON_FRONTEND
DIAGNOSTICS with listOf("-UNUSED_PARAMETER", "-PRE_RELEASE_CLASS")
}