[JS] Report K2 diagnostics before Fir2IR
^KT-60531 fixed
This commit is contained in:
committed by
Space Team
parent
3590f0aa03
commit
387898056a
@@ -524,6 +524,10 @@ class K2JsIrCompiler : CLICompiler<K2JSCompilerArguments>() {
|
||||
)
|
||||
}
|
||||
|
||||
if (analyzedOutput.reportCompilationErrors(moduleStructure, diagnosticsReporter, messageCollector)) {
|
||||
throw CompilationErrorException()
|
||||
}
|
||||
|
||||
// FIR2IR
|
||||
val fir2IrActualizedResult = transformFirToIr(moduleStructure, analyzedOutput.output, diagnosticsReporter)
|
||||
|
||||
@@ -539,10 +543,6 @@ class K2JsIrCompiler : CLICompiler<K2JSCompilerArguments>() {
|
||||
}
|
||||
}
|
||||
|
||||
if (analyzedOutput.reportCompilationErrors(moduleStructure, diagnosticsReporter, messageCollector)) {
|
||||
throw CompilationErrorException()
|
||||
}
|
||||
|
||||
// Serialize klib
|
||||
if (arguments.irProduceKlibDir || arguments.irProduceKlibFile) {
|
||||
serializeFirKlib(
|
||||
|
||||
+2
-71
@@ -58,7 +58,7 @@ public class IncrementalK2JsKlibCompilerWithScopeExpansionRunnerTestGenerated ex
|
||||
}
|
||||
|
||||
public void testAllFilesPresentInPureKotlin() throws Exception {
|
||||
KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("jps/jps-plugin/testData/incremental/pureKotlin"), Pattern.compile("^([^\\.]+)$"), Pattern.compile("^(sealed|fileWithConstantRemoved).*"), false);
|
||||
KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("jps/jps-plugin/testData/incremental/pureKotlin"), Pattern.compile("^([^\\.]+)$"), Pattern.compile("^(sealed.*|fileWithConstantRemoved|propertyRedeclaration|funRedeclaration|funVsConstructorOverloadConflict)"), false);
|
||||
}
|
||||
|
||||
@TestMetadata("annotations")
|
||||
@@ -226,16 +226,6 @@ public class IncrementalK2JsKlibCompilerWithScopeExpansionRunnerTestGenerated ex
|
||||
runTest("jps/jps-plugin/testData/incremental/pureKotlin/filesExchangePackages/");
|
||||
}
|
||||
|
||||
@TestMetadata("funRedeclaration")
|
||||
public void testFunRedeclaration() throws Exception {
|
||||
runTest("jps/jps-plugin/testData/incremental/pureKotlin/funRedeclaration/");
|
||||
}
|
||||
|
||||
@TestMetadata("funVsConstructorOverloadConflict")
|
||||
public void testFunVsConstructorOverloadConflict() throws Exception {
|
||||
runTest("jps/jps-plugin/testData/incremental/pureKotlin/funVsConstructorOverloadConflict/");
|
||||
}
|
||||
|
||||
@TestMetadata("functionBecameInline")
|
||||
public void testFunctionBecameInline() throws Exception {
|
||||
runTest("jps/jps-plugin/testData/incremental/pureKotlin/functionBecameInline/");
|
||||
@@ -516,11 +506,6 @@ public class IncrementalK2JsKlibCompilerWithScopeExpansionRunnerTestGenerated ex
|
||||
runTest("jps/jps-plugin/testData/incremental/pureKotlin/privateVarSignatureChanged/");
|
||||
}
|
||||
|
||||
@TestMetadata("propertyRedeclaration")
|
||||
public void testPropertyRedeclaration() throws Exception {
|
||||
runTest("jps/jps-plugin/testData/incremental/pureKotlin/propertyRedeclaration/");
|
||||
}
|
||||
|
||||
@TestMetadata("publicPropertyWithPrivateSetter")
|
||||
public void testPublicPropertyWithPrivateSetter() throws Exception {
|
||||
runTest("jps/jps-plugin/testData/incremental/pureKotlin/publicPropertyWithPrivateSetter/");
|
||||
@@ -666,7 +651,7 @@ public class IncrementalK2JsKlibCompilerWithScopeExpansionRunnerTestGenerated ex
|
||||
}
|
||||
|
||||
public void testAllFilesPresentInClassHierarchyAffected() throws Exception {
|
||||
KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("jps/jps-plugin/testData/incremental/classHierarchyAffected"), Pattern.compile("^([^\\.]+)$"), null, false);
|
||||
KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("jps/jps-plugin/testData/incremental/classHierarchyAffected"), Pattern.compile("^([^\\.]+)$"), Pattern.compile("secondaryConstructorAdded"), false);
|
||||
}
|
||||
|
||||
@TestMetadata("annotationFlagRemoved")
|
||||
@@ -844,11 +829,6 @@ public class IncrementalK2JsKlibCompilerWithScopeExpansionRunnerTestGenerated ex
|
||||
runTest("jps/jps-plugin/testData/incremental/classHierarchyAffected/sealedClassNestedImplAdded/");
|
||||
}
|
||||
|
||||
@TestMetadata("secondaryConstructorAdded")
|
||||
public void testSecondaryConstructorAdded() throws Exception {
|
||||
runTest("jps/jps-plugin/testData/incremental/classHierarchyAffected/secondaryConstructorAdded/");
|
||||
}
|
||||
|
||||
@TestMetadata("starProjectionUpperBoundChanged")
|
||||
public void testStarProjectionUpperBoundChanged() throws Exception {
|
||||
runTest("jps/jps-plugin/testData/incremental/classHierarchyAffected/starProjectionUpperBoundChanged/");
|
||||
@@ -936,53 +916,4 @@ public class IncrementalK2JsKlibCompilerWithScopeExpansionRunnerTestGenerated ex
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@TestMetadata("jps/jps-plugin/testData/incremental/scopeExpansion")
|
||||
@TestDataPath("$PROJECT_ROOT")
|
||||
@RunWith(JUnit3RunnerWithInners.class)
|
||||
public static class ScopeExpansion extends AbstractIncrementalK2JsKlibCompilerWithScopeExpansionRunnerTest {
|
||||
private void runTest(String testDataFilePath) throws Exception {
|
||||
KotlinTestUtils.runTest(this::doTest, this, testDataFilePath);
|
||||
}
|
||||
|
||||
public void testAllFilesPresentInScopeExpansion() throws Exception {
|
||||
KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("jps/jps-plugin/testData/incremental/scopeExpansion"), Pattern.compile("^([^\\.]+)$"), null, true);
|
||||
}
|
||||
|
||||
@TestMetadata("changeTypeAliasAndUsage")
|
||||
public void testChangeTypeAliasAndUsage() throws Exception {
|
||||
runTest("jps/jps-plugin/testData/incremental/scopeExpansion/changeTypeAliasAndUsage/");
|
||||
}
|
||||
|
||||
@TestMetadata("protectedBecomesPublicAccessedTroughChild")
|
||||
public void testProtectedBecomesPublicAccessedTroughChild() throws Exception {
|
||||
runTest("jps/jps-plugin/testData/incremental/scopeExpansion/protectedBecomesPublicAccessedTroughChild/");
|
||||
}
|
||||
|
||||
@TestMetadata("jps/jps-plugin/testData/incremental/scopeExpansion/changeTypeAliasAndUsage")
|
||||
@TestDataPath("$PROJECT_ROOT")
|
||||
@RunWith(JUnit3RunnerWithInners.class)
|
||||
public static class ChangeTypeAliasAndUsage extends AbstractIncrementalK2JsKlibCompilerWithScopeExpansionRunnerTest {
|
||||
private void runTest(String testDataFilePath) throws Exception {
|
||||
KotlinTestUtils.runTest(this::doTest, this, testDataFilePath);
|
||||
}
|
||||
|
||||
public void testAllFilesPresentInChangeTypeAliasAndUsage() throws Exception {
|
||||
KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("jps/jps-plugin/testData/incremental/scopeExpansion/changeTypeAliasAndUsage"), Pattern.compile("^([^\\.]+)$"), null, true);
|
||||
}
|
||||
}
|
||||
|
||||
@TestMetadata("jps/jps-plugin/testData/incremental/scopeExpansion/protectedBecomesPublicAccessedTroughChild")
|
||||
@TestDataPath("$PROJECT_ROOT")
|
||||
@RunWith(JUnit3RunnerWithInners.class)
|
||||
public static class ProtectedBecomesPublicAccessedTroughChild extends AbstractIncrementalK2JsKlibCompilerWithScopeExpansionRunnerTest {
|
||||
private void runTest(String testDataFilePath) throws Exception {
|
||||
KotlinTestUtils.runTest(this::doTest, this, testDataFilePath);
|
||||
}
|
||||
|
||||
public void testAllFilesPresentInProtectedBecomesPublicAccessedTroughChild() throws Exception {
|
||||
KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("jps/jps-plugin/testData/incremental/scopeExpansion/protectedBecomesPublicAccessedTroughChild"), Pattern.compile("^([^\\.]+)$"), null, true);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -119,14 +119,19 @@ fun main(args: Array<String>) {
|
||||
model("incremental/scopeExpansion", extension = null, excludeParentDirs = true)
|
||||
}
|
||||
|
||||
// TODO: https://youtrack.jetbrains.com/issue/KT-61602/JS-K2-ICL-Fix-muted-tests
|
||||
testClass<AbstractIncrementalK2JsKlibCompilerWithScopeExpansionRunnerTest> {
|
||||
// IC of sealed interfaces are not supported in JS
|
||||
model("incremental/pureKotlin", extension = null, recursive = false,
|
||||
// TODO: 'fileWithConstantRemoved' should be fixed in https://youtrack.jetbrains.com/issue/KT-58824
|
||||
excludedPattern = "^(sealed|fileWithConstantRemoved).*")
|
||||
model("incremental/classHierarchyAffected", extension = null, recursive = false)
|
||||
excludedPattern = "^(sealed.*|fileWithConstantRemoved|propertyRedeclaration|funRedeclaration|funVsConstructorOverloadConflict)"
|
||||
)
|
||||
model("incremental/classHierarchyAffected", extension = null, recursive = false,
|
||||
excludedPattern = "secondaryConstructorAdded"
|
||||
)
|
||||
model("incremental/js", extension = null, excludeParentDirs = true)
|
||||
model("incremental/scopeExpansion", extension = null, excludeParentDirs = true)
|
||||
|
||||
//model("incremental/scopeExpansion", extension = null, excludeParentDirs = true)
|
||||
}
|
||||
|
||||
testClass<AbstractIncrementalK1JsLegacyCompilerRunnerWithFriendModulesDisabledTest> {
|
||||
|
||||
Reference in New Issue
Block a user