Invert LanguageFeature responsible for warning on coroutines

The problem was that LanguageVersionSettingsImpl.DEFAULT did not have
"WarnOnCoroutines" as a feature and so it was manually added to the settings,
but only in two places: in the compiler and in the IDE
This commit is contained in:
Alexander Udalov
2017-02-16 18:41:23 +03:00
parent e3dab96715
commit a9678010a8
11 changed files with 38 additions and 33 deletions
@@ -288,19 +288,19 @@ public abstract class CLICompiler<A extends CommonCompilerArguments> {
@Nullable
private static LanguageFeature chooseCoroutinesApplicabilityLevel(
@NotNull CompilerConfiguration configuration, @NotNull CommonCompilerArguments arguments) {
if (!arguments.coroutinesEnable && !arguments.coroutinesError && !arguments.coroutinesWarn) {
return LanguageFeature.WarnOnCoroutines;
}
else if (arguments.coroutinesError && !arguments.coroutinesWarn && !arguments.coroutinesEnable) {
@NotNull CompilerConfiguration configuration,
@NotNull CommonCompilerArguments arguments
) {
if (arguments.coroutinesError && !arguments.coroutinesWarn && !arguments.coroutinesEnable) {
return LanguageFeature.ErrorOnCoroutines;
}
else if (arguments.coroutinesWarn && !arguments.coroutinesError && !arguments.coroutinesEnable) {
return LanguageFeature.WarnOnCoroutines;
}
else if (arguments.coroutinesEnable && !arguments.coroutinesWarn && !arguments.coroutinesError) {
return LanguageFeature.DoNotWarnOnCoroutines;
}
else if (!arguments.coroutinesEnable && !arguments.coroutinesError) {
return null;
} else {
}
else {
String message = "The -Xcoroutines can only have one value";
configuration.getNotNull(CLIConfigurationKeys.MESSAGE_COLLECTOR_KEY).report(
CompilerMessageSeverity.ERROR, message, CompilerMessageLocation.NO_LOCATION