Kotlin Facet: Do not rewrite language/API version based on compiler arguments if they do not contain explicit language/API version

This commit is contained in:
Alexey Sedunov
2017-02-15 12:26:28 +03:00
parent 2790fcf4bd
commit 0d2122bb1d
@@ -242,8 +242,8 @@ fun parseCompilerArgumentsToFacet(arguments: List<String>, defaultArguments: Lis
val restoreCoroutineSupport =
!compilerArguments.coroutinesEnable && !compilerArguments.coroutinesWarn && !compilerArguments.coroutinesError
versionInfo.apiLevel = LanguageVersion.fromVersionString(compilerArguments.apiVersion)
versionInfo.languageLevel = LanguageVersion.fromVersionString(compilerArguments.languageVersion)
compilerArguments.apiVersion?.let { versionInfo.apiLevel = LanguageVersion.fromVersionString(it) }
compilerArguments.languageVersion?.let { versionInfo.languageLevel = LanguageVersion.fromVersionString(it) }
if (versionInfo.targetPlatformKind is TargetPlatformKind.Jvm) {
val jvmTarget = compilerInfo.k2jvmCompilerArguments!!.jvmTarget