From 62e1d49def885d63b8eafd699f895ada495e7447 Mon Sep 17 00:00:00 2001 From: Dmitry Jemerov Date: Tue, 31 Jan 2017 14:21:08 +0100 Subject: [PATCH] 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 --- idea/src/org/jetbrains/kotlin/idea/facet/facetUtils.kt | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/idea/src/org/jetbrains/kotlin/idea/facet/facetUtils.kt b/idea/src/org/jetbrains/kotlin/idea/facet/facetUtils.kt index 65d8b41a023..0baabdc6605 100644 --- a/idea/src/org/jetbrains/kotlin/idea/facet/facetUtils.kt +++ b/idea/src/org/jetbrains/kotlin/idea/facet/facetUtils.kt @@ -189,7 +189,16 @@ fun parseCompilerArgumentsToFacet(arguments: List, 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) }