From 2c08796c452d2d7204328fd3004e13a805054fe1 Mon Sep 17 00:00:00 2001 From: Alexander Udalov Date: Wed, 13 Jul 2016 17:56:42 +0300 Subject: [PATCH] Report ABI version incompatibility error always, not only if there are other errors This is a radical but likely temporary measure to forbid the current compiler from compiling code against binaries compiled by newer compilers Cherry picked from commit 149a4eddff0106bbe91c9a6b51a26c12c242d14f and commit 285b20e3ff387eb3d2ee33ceaa376ed8eba90857 --- .../kotlin/cli/common/messages/AnalyzerWithCompilerReport.kt | 4 +--- compiler/testData/cli/jvm/wrongAbiVersionNoErrors.kt | 2 +- compiler/testData/cli/jvm/wrongAbiVersionNoErrors.out | 3 ++- 3 files changed, 4 insertions(+), 5 deletions(-) diff --git a/compiler/cli/src/org/jetbrains/kotlin/cli/common/messages/AnalyzerWithCompilerReport.kt b/compiler/cli/src/org/jetbrains/kotlin/cli/common/messages/AnalyzerWithCompilerReport.kt index 8ee8e78a437..7551bd4d282 100644 --- a/compiler/cli/src/org/jetbrains/kotlin/cli/common/messages/AnalyzerWithCompilerReport.kt +++ b/compiler/cli/src/org/jetbrains/kotlin/cli/common/messages/AnalyzerWithCompilerReport.kt @@ -130,9 +130,7 @@ class AnalyzerWithCompilerReport(private val messageCollector: MessageCollector) } val abiVersionErrors = abiVersionErrors reportDiagnostics(analysisResult.bindingContext.diagnostics, messageCollector, !abiVersionErrors.isEmpty()) - if (hasErrors()) { - reportMetadataVersionErrors(abiVersionErrors) - } + reportMetadataVersionErrors(abiVersionErrors) reportIncompleteHierarchies() reportAlternativeSignatureErrors() } diff --git a/compiler/testData/cli/jvm/wrongAbiVersionNoErrors.kt b/compiler/testData/cli/jvm/wrongAbiVersionNoErrors.kt index 8dc96a5d49b..f60a6d49da2 100644 --- a/compiler/testData/cli/jvm/wrongAbiVersionNoErrors.kt +++ b/compiler/testData/cli/jvm/wrongAbiVersionNoErrors.kt @@ -1,4 +1,4 @@ -// This should compile despite the fact that there are usages of symbols with the wrong ABI version! +// This should not compile because there are usages of symbols with the wrong ABI version! import wrong.ClassWithInnerLambda diff --git a/compiler/testData/cli/jvm/wrongAbiVersionNoErrors.out b/compiler/testData/cli/jvm/wrongAbiVersionNoErrors.out index d86bac9de59..16cbc5fb4ba 100644 --- a/compiler/testData/cli/jvm/wrongAbiVersionNoErrors.out +++ b/compiler/testData/cli/jvm/wrongAbiVersionNoErrors.out @@ -1 +1,2 @@ -OK +compiler/testData/cli/jvm/wrongAbiVersionLib/bin/wrong/ClassWithInnerLambda.class: error: class 'wrong/ClassWithInnerLambda' was compiled with an incompatible version of Kotlin. The binary version of its metadata is 0.30.0, expected version is $ABI_VERSION$ +COMPILATION_ERROR \ No newline at end of file