[FIR] Fir2IrJsResultsConverter: Compute hasErrors of backend input
- This allows us to re-enable 3 tests.
This commit is contained in:
committed by
Space Team
parent
49c3ba33f1
commit
dbb02a9bfb
@@ -1,6 +1,5 @@
|
||||
// IGNORE_ERRORS
|
||||
// ERROR_POLICY: SEMANTIC
|
||||
// IGNORE_BACKEND_K2: JS_IR
|
||||
|
||||
// MODULE: lib
|
||||
// FILE: t.kt
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
// IGNORE_ERRORS
|
||||
// ERROR_POLICY: SEMANTIC
|
||||
// IGNORE_BACKEND_K2: JS_IR
|
||||
|
||||
// MODULE: lib
|
||||
// FILE: t.kt
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
// IGNORE_ERRORS
|
||||
// ERROR_POLICY: SYNTAX
|
||||
// IGNORE_BACKEND_K2: JS_IR
|
||||
|
||||
// MODULE: lib
|
||||
// FILE: t.kt
|
||||
|
||||
+6
-1
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user