From 057059295250f9e5766e4940b2df7f68cb62a2f8 Mon Sep 17 00:00:00 2001 From: Alexey Sedunov Date: Thu, 8 Jun 2017 20:04:50 +0300 Subject: [PATCH] Kotlin Facet: Avoid rewriting platform version with project settings #KT-18373 Fixed --- .../kotlin/idea/facet/KotlinFacetEditorGeneralTab.kt | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/idea/src/org/jetbrains/kotlin/idea/facet/KotlinFacetEditorGeneralTab.kt b/idea/src/org/jetbrains/kotlin/idea/facet/KotlinFacetEditorGeneralTab.kt index d3e773eaf04..c31e48f1131 100644 --- a/idea/src/org/jetbrains/kotlin/idea/facet/KotlinFacetEditorGeneralTab.kt +++ b/idea/src/org/jetbrains/kotlin/idea/facet/KotlinFacetEditorGeneralTab.kt @@ -301,17 +301,17 @@ class KotlinFacetEditorGeneralTab( useProjectSettings = editor.useProjectSettingsCheckBox.isSelected (editor.targetPlatformComboBox.selectedItem as TargetPlatformKind<*>?)?.let { if (it != targetPlatformKind) { - val newCompilerArguments = it.createCompilerArguments() val platformArguments = when (it) { is TargetPlatformKind.Jvm -> editor.compilerConfigurable.k2jvmCompilerArguments is TargetPlatformKind.JavaScript -> editor.compilerConfigurable.k2jsCompilerArguments else -> null } - if (platformArguments != null) { - mergeBeans(platformArguments, newCompilerArguments) + compilerArguments = it.createCompilerArguments { + if (platformArguments != null) { + mergeBeans(platformArguments, this) + } + copyInheritedFields(compilerArguments!!, this) } - copyInheritedFields(compilerArguments!!, newCompilerArguments) - compilerArguments = newCompilerArguments } } }