diff --git a/compiler/testData/codegen/boxError/semantic/castToErrorType.kt b/compiler/testData/codegen/boxError/semantic/castToErrorType.kt index d69e65aa9ca..f079006940a 100644 --- a/compiler/testData/codegen/boxError/semantic/castToErrorType.kt +++ b/compiler/testData/codegen/boxError/semantic/castToErrorType.kt @@ -1,6 +1,5 @@ // IGNORE_ERRORS // ERROR_POLICY: SEMANTIC -// IGNORE_BACKEND_K2: JS_IR // MODULE: lib // FILE: t.kt diff --git a/compiler/testData/codegen/boxError/semantic/reifiedNonInline.kt b/compiler/testData/codegen/boxError/semantic/reifiedNonInline.kt index e487957b1f0..eb7d410c652 100644 --- a/compiler/testData/codegen/boxError/semantic/reifiedNonInline.kt +++ b/compiler/testData/codegen/boxError/semantic/reifiedNonInline.kt @@ -1,6 +1,5 @@ // IGNORE_ERRORS // ERROR_POLICY: SEMANTIC -// IGNORE_BACKEND_K2: JS_IR // MODULE: lib // FILE: t.kt diff --git a/compiler/testData/codegen/boxError/syntax/arrowReference.kt b/compiler/testData/codegen/boxError/syntax/arrowReference.kt index 92991fdb22f..27c6c48aee7 100644 --- a/compiler/testData/codegen/boxError/syntax/arrowReference.kt +++ b/compiler/testData/codegen/boxError/syntax/arrowReference.kt @@ -1,6 +1,5 @@ // IGNORE_ERRORS // ERROR_POLICY: SYNTAX -// IGNORE_BACKEND_K2: JS_IR // MODULE: lib // FILE: t.kt diff --git a/compiler/tests-common-new/tests/org/jetbrains/kotlin/test/frontend/fir/Fir2IrJsResultsConverter.kt b/compiler/tests-common-new/tests/org/jetbrains/kotlin/test/frontend/fir/Fir2IrJsResultsConverter.kt index b0ea91ed18a..3498a72a49f 100644 --- a/compiler/tests-common-new/tests/org/jetbrains/kotlin/test/frontend/fir/Fir2IrJsResultsConverter.kt +++ b/compiler/tests-common-new/tests/org/jetbrains/kotlin/test/frontend/fir/Fir2IrJsResultsConverter.kt @@ -16,6 +16,7 @@ import org.jetbrains.kotlin.config.languageVersionSettings import org.jetbrains.kotlin.descriptors.DeclarationDescriptor import org.jetbrains.kotlin.descriptors.ModuleDescriptor import org.jetbrains.kotlin.descriptors.impl.ModuleDescriptorImpl +import org.jetbrains.kotlin.diagnostics.Severity import org.jetbrains.kotlin.fir.AbstractFirAnalyzerFacade import org.jetbrains.kotlin.fir.FirAnalyzerFacade import org.jetbrains.kotlin.fir.FirSession @@ -79,12 +80,16 @@ class Fir2IrJsResultsConverter( configuration.get(CommonConfigurationKeys.METADATA_VERSION) ?: GenerationState.LANGUAGE_TO_METADATA_VERSION.getValue(module.languageVersionSettings.languageVersion) + // At this point, checkers will already have been run by a previous test step. `runCheckers` returns the cached diagnostics map. + val diagnosticsMap = inputArtifact.firAnalyzerFacade.runCheckers() + val hasErrors = diagnosticsMap.any { entry -> entry.value.any { it.severity == Severity.ERROR } } + return IrBackendInput.JsIrBackendInput( irModuleFragment, sourceFiles, icData, expectDescriptorToSymbol, - hasErrors = false // TODO: implement error check + hasErrors, ) { file -> val firFile = firFilesBySourceFile[file] ?: error("cannot find FIR file by source file ${file.name} (${file.path})") serializeSingleFirFile(firFile, components.session, components.scopeSession, metadataVersion)