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.
This commit is contained in:
Alexander Udalov
2020-02-07 17:44:31 +01:00
parent b8aacf0786
commit dc7b1fbff9
3 changed files with 7 additions and 6 deletions
@@ -360,8 +360,9 @@ class K2JVMCompilerArguments : CommonCompilerArguments() {
|| languageVersionSettings.apiVersion < ApiVersion.KOTLIN_1_3 || languageVersionSettings.apiVersion < ApiVersion.KOTLIN_1_3
) { ) {
collector.report( collector.report(
CompilerMessageSeverity.ERROR, CompilerMessageSeverity.STRONG_WARNING,
"IR backend cannot be used with language or API version below 1.3" "IR backend does not support language or API version lower than 1.3. " +
"This can lead to unexpected behavior or compilation failures"
) )
} }
} }
+2 -2
View File
@@ -1,3 +1,3 @@
warning: API version 1.2 is deprecated and its support will be removed in a future version of Kotlin 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 warning: IR backend does not support language or API version lower than 1.3. This can lead to unexpected behavior or compilation failures
COMPILATION_ERROR OK
+2 -2
View File
@@ -1,3 +1,3 @@
warning: language version 1.2 is deprecated and its support will be removed in a future version of Kotlin 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 warning: IR backend does not support language or API version lower than 1.3. This can lead to unexpected behavior or compilation failures
COMPILATION_ERROR OK