Skip to content

Commit dbfe337

Browse files
committed
Kotlin Facet: Ignore invalid platform-specific compiler arguments
1 parent 1e2b503 commit dbfe337

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

idea/src/org/jetbrains/kotlin/idea/facet/facetUtils.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -205,14 +205,14 @@ fun parseCompilerArgumentsToFacet(arguments: List<String>, kotlinFacet: KotlinFa
205205

206206
when (versionInfo.targetPlatformKind) {
207207
is TargetPlatformKind.Jvm -> {
208-
val jvmTarget = K2JVMCompilerArguments().apply { parseArguments(argumentArray, this) }.jvmTarget
208+
val jvmTarget = K2JVMCompilerArguments().apply { parseArguments(argumentArray, this, ignoreInvalidArguments = true) }.jvmTarget
209209
if (jvmTarget != null) {
210210
versionInfo.targetPlatformKind = TargetPlatformKind.Jvm.JVM_PLATFORMS.firstOrNull {
211211
VersionComparatorUtil.compare(it.version.description, jvmTarget) >= 0
212212
} ?: TargetPlatformKind.Jvm.JVM_PLATFORMS.last()
213213
}
214214
}
215-
is TargetPlatformKind.JavaScript -> parseArguments(argumentArray, compilerInfo.k2jsCompilerArguments!!)
215+
is TargetPlatformKind.JavaScript -> parseArguments(argumentArray, compilerInfo.k2jsCompilerArguments!!, ignoreInvalidArguments = true)
216216
else -> {}
217217
}
218218

0 commit comments

Comments
 (0)