From 4e8d6d48828c7cf0bdbcfc73d3398fa65c3fe3d8 Mon Sep 17 00:00:00 2001 From: Alexander Udalov Date: Tue, 20 May 2014 16:13:45 +0400 Subject: [PATCH] Report ABI version errors before diagnostics and other errors Otherwise they're difficult to find in the end of the compiler messages --- .../cli/common/messages/AnalyzerWithCompilerReport.java | 7 ++++--- compiler/testData/cli/jvm/wrongAbiVersion.out | 4 ++-- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/compiler/cli/src/org/jetbrains/jet/cli/common/messages/AnalyzerWithCompilerReport.java b/compiler/cli/src/org/jetbrains/jet/cli/common/messages/AnalyzerWithCompilerReport.java index ed861cc1810..edf1b8dbc41 100644 --- a/compiler/cli/src/org/jetbrains/jet/cli/common/messages/AnalyzerWithCompilerReport.java +++ b/compiler/cli/src/org/jetbrains/jet/cli/common/messages/AnalyzerWithCompilerReport.java @@ -223,17 +223,18 @@ public final class AnalyzerWithCompilerReport { } public void analyzeAndReport(@NotNull Function0 analyzer, @NotNull Collection files) { - reportSyntaxErrors(files); analyzeExhaust = analyzer.invoke(); + reportAbiVersionErrors(); + reportSyntaxErrors(files); + //noinspection ConstantConditions reportDiagnostics(analyzeExhaust.getBindingContext(), messageCollectorWrapper); reportIncompleteHierarchies(); reportAlternativeSignatureErrors(); - reportAbiVersionErrors(); } private static class MyDiagnostic extends SimpleDiagnostic { - private String message; + private final String message; public MyDiagnostic(@NotNull E psiElement, @NotNull DiagnosticFactory0 factory, String message) { super(psiElement, factory, Severity.ERROR); diff --git a/compiler/testData/cli/jvm/wrongAbiVersion.out b/compiler/testData/cli/jvm/wrongAbiVersion.out index a18d87036d1..08c94b49d1f 100644 --- a/compiler/testData/cli/jvm/wrongAbiVersion.out +++ b/compiler/testData/cli/jvm/wrongAbiVersion.out @@ -1,5 +1,5 @@ -WARNING: $TESTDATA_DIR$/wrongAbiVersion.kt: (3, 9) Parameter 'x' is never used -ERROR: $TESTDATA_DIR$/wrongAbiVersion.kt: (4, 3) Unresolved reference: bar ERROR: $TESTDATA_DIR$/wrongAbiVersionLib/ClassWithWrongAbiVersion.class: (0, 0) Class 'ClassWithWrongAbiVersion' was compiled with an incompatible version of Kotlin. Its ABI version is -1, expected ABI version is $ABI_VERSION$ ERROR: $TESTDATA_DIR$/wrongAbiVersionLib/wrong/WrongPackage.class: (0, 0) Class 'wrong/WrongPackage' was compiled with an incompatible version of Kotlin. Its ABI version is -1, expected ABI version is $ABI_VERSION$ +WARNING: $TESTDATA_DIR$/wrongAbiVersion.kt: (3, 9) Parameter 'x' is never used +ERROR: $TESTDATA_DIR$/wrongAbiVersion.kt: (4, 3) Unresolved reference: bar COMPILATION_ERROR \ No newline at end of file