From 5027a76ed4bfafbb039ee7b3a592e277295618d6 Mon Sep 17 00:00:00 2001 From: Mikhail Zarechenskiy Date: Tue, 28 Mar 2017 14:38:39 +0300 Subject: [PATCH] Add strong warning when trying to compile with experimental LV --- .../src/org/jetbrains/kotlin/cli/common/CLICompiler.java | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/compiler/cli/src/org/jetbrains/kotlin/cli/common/CLICompiler.java b/compiler/cli/src/org/jetbrains/kotlin/cli/common/CLICompiler.java index a3c63f9344d..0817a852623 100644 --- a/compiler/cli/src/org/jetbrains/kotlin/cli/common/CLICompiler.java +++ b/compiler/cli/src/org/jetbrains/kotlin/cli/common/CLICompiler.java @@ -253,6 +253,15 @@ public abstract class CLICompiler { ); } + if (languageVersion.compareTo(LanguageVersion.LATEST_STABLE) > 0) { + configuration.getNotNull(CLIConfigurationKeys.MESSAGE_COLLECTOR_KEY).report( + CompilerMessageSeverity.STRONG_WARNING, + "Language version " + languageVersion.getVersionString() + " is experimental, there are " + + "no backwards compatibility guarantees for new language and library features", + CompilerMessageLocation.NO_LOCATION + ); + } + Map extraLanguageFeatures = new HashMap(0); if (arguments.multiPlatform) { extraLanguageFeatures.put(LanguageFeature.MultiPlatformProjects, LanguageFeature.State.ENABLED);