[FIR] KT-57803: Report the error message for light tree

The renaming prevents the JVM clash.

^KT-57803 Fixed
This commit is contained in:
Nikolay Lunyak
2023-05-26 13:12:44 +03:00
committed by Space Team
parent 7f74950993
commit 23f87eda1f
16 changed files with 114 additions and 19 deletions
@@ -0,0 +1,12 @@
/*
* Copyright 2010-2023 JetBrains s.r.o. and Kotlin Programming Language contributors.
* Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file.
*/
package org.jetbrains.kotlin.cli.js
import org.jetbrains.kotlin.config.CompilerConfiguration
import org.jetbrains.kotlin.psi.KtFile
fun checkKotlinPackageUsageForPsi(configuration: CompilerConfiguration, files: Collection<KtFile>) =
org.jetbrains.kotlin.cli.common.checkKotlinPackageUsageForPsi(configuration, files)
@@ -220,7 +220,7 @@ public class K2JSCompiler extends CLICompiler<K2JSCompilerArguments> {
environmentForJS.getConfiguration().put(CLIConfigurationKeys.RENDER_DIAGNOSTIC_INTERNAL_NAME, arguments.getRenderInternalDiagnosticNames());
if (!UtilsKt.checkKotlinPackageUsage(environmentForJS.getConfiguration(), sourcesFiles)) return ExitCode.COMPILATION_ERROR;
if (!HelpersKt.checkKotlinPackageUsageForPsi(environmentForJS.getConfiguration(), sourcesFiles)) return ExitCode.COMPILATION_ERROR;
if (arguments.getOutputFile() == null) {
messageCollector.report(ERROR, "Specify output file via -output", null);
@@ -208,7 +208,7 @@ class K2JsIrCompiler : CLICompiler<K2JSCompilerArguments>() {
Disposer.register(rootDisposable, zipAccessor)
configurationJs.put(JSConfigurationKeys.ZIP_FILE_SYSTEM_ACCESSOR, zipAccessor)
if (!checkKotlinPackageUsage(environmentForJS.configuration, sourcesFiles)) return COMPILATION_ERROR
if (!checkKotlinPackageUsageForPsi(environmentForJS.configuration, sourcesFiles)) return COMPILATION_ERROR
val outputDirPath = arguments.outputDir
val outputName = arguments.moduleName