From dc7b1fbff946d1476cc9652710df85f65664baee Mon Sep 17 00:00:00 2001 From: Alexander Udalov Date: Fri, 7 Feb 2020 17:44:31 +0100 Subject: [PATCH] JVM IR: report warning instead of error for language/API version 1.2 This is needed for testing JVM IR on existing projects which for some reason are still on Kotlin 1.2. --- .../kotlin/cli/common/arguments/K2JVMCompilerArguments.kt | 5 +++-- compiler/testData/cli/jvm/irApiVersionUnsupported.out | 4 ++-- compiler/testData/cli/jvm/irLanguageVersionUnsupported.out | 4 ++-- 3 files changed, 7 insertions(+), 6 deletions(-) diff --git a/compiler/cli/cli-common/src/org/jetbrains/kotlin/cli/common/arguments/K2JVMCompilerArguments.kt b/compiler/cli/cli-common/src/org/jetbrains/kotlin/cli/common/arguments/K2JVMCompilerArguments.kt index b91b618845d..cabaffed89a 100644 --- a/compiler/cli/cli-common/src/org/jetbrains/kotlin/cli/common/arguments/K2JVMCompilerArguments.kt +++ b/compiler/cli/cli-common/src/org/jetbrains/kotlin/cli/common/arguments/K2JVMCompilerArguments.kt @@ -360,8 +360,9 @@ class K2JVMCompilerArguments : CommonCompilerArguments() { || languageVersionSettings.apiVersion < ApiVersion.KOTLIN_1_3 ) { collector.report( - CompilerMessageSeverity.ERROR, - "IR backend cannot be used with language or API version below 1.3" + CompilerMessageSeverity.STRONG_WARNING, + "IR backend does not support language or API version lower than 1.3. " + + "This can lead to unexpected behavior or compilation failures" ) } } diff --git a/compiler/testData/cli/jvm/irApiVersionUnsupported.out b/compiler/testData/cli/jvm/irApiVersionUnsupported.out index 9a6cb045795..50862059811 100644 --- a/compiler/testData/cli/jvm/irApiVersionUnsupported.out +++ b/compiler/testData/cli/jvm/irApiVersionUnsupported.out @@ -1,3 +1,3 @@ warning: API version 1.2 is deprecated and its support will be removed in a future version of Kotlin -error: IR backend cannot be used with language or API version below 1.3 -COMPILATION_ERROR +warning: IR backend does not support language or API version lower than 1.3. This can lead to unexpected behavior or compilation failures +OK diff --git a/compiler/testData/cli/jvm/irLanguageVersionUnsupported.out b/compiler/testData/cli/jvm/irLanguageVersionUnsupported.out index 3914b5bd907..3f22a2135cc 100644 --- a/compiler/testData/cli/jvm/irLanguageVersionUnsupported.out +++ b/compiler/testData/cli/jvm/irLanguageVersionUnsupported.out @@ -1,3 +1,3 @@ warning: language version 1.2 is deprecated and its support will be removed in a future version of Kotlin -error: IR backend cannot be used with language or API version below 1.3 -COMPILATION_ERROR +warning: IR backend does not support language or API version lower than 1.3. This can lead to unexpected behavior or compilation failures +OK