Make sure that we don't have multiple coroutine status flags in the facet settings if one flag was set before parsing the command line options and another is specified through the command line options.

#KT-16075 Fixed
This commit is contained in:
Dmitry Jemerov
2017-01-31 14:21:08 +01:00
parent 464820458e
commit 62e1d49def
@@ -189,7 +189,16 @@ fun parseCompilerArgumentsToFacet(arguments: List<String>, kotlinFacet: KotlinFa
with(kotlinFacet.configuration.settings) {
// todo: merge common arguments with platform-specific ones in facet settings
compilerInfo.commonCompilerArguments!!.let { commonCompilerArguments ->
val oldCoroutineSupport = CoroutineSupport.byCompilerArguments(commonCompilerArguments)
commonCompilerArguments.coroutinesEnable = false
commonCompilerArguments.coroutinesWarn = false
commonCompilerArguments.coroutinesError = false
parseArguments(argumentArray, commonCompilerArguments, ignoreInvalidArguments = true)
if (!commonCompilerArguments.coroutinesEnable && !commonCompilerArguments.coroutinesWarn && !commonCompilerArguments.coroutinesError) {
compilerInfo.coroutineSupport = oldCoroutineSupport
}
versionInfo.apiLevel = LanguageVersion.fromVersionString(commonCompilerArguments.apiVersion)
versionInfo.languageLevel = LanguageVersion.fromVersionString(commonCompilerArguments.languageVersion)
}