Do not coerce inferred language levels when importing from facet
Rationaly is that facet importer knows better about which language versions should be used, so we shouldn't interfere. Otherwise, Gradle or Maven projects which have upgraded corresponding plugin to 1.3 will be imported with 1.2 levels, which is undesirable
This commit is contained in:
committed by
Ilya Gorbunov
parent
90ec151258
commit
2ecea06d3e
@@ -82,14 +82,21 @@ fun KotlinFacetSettings.initializeIfNeeded(
|
||||
|
||||
if (shouldInferLanguageLevel) {
|
||||
languageLevel = (if (useProjectSettings) LanguageVersion.fromVersionString(commonArguments.languageVersion) else null)
|
||||
?: getDefaultLanguageLevel(module, compilerVersion)
|
||||
?: getDefaultLanguageLevel(module, compilerVersion, coerceRuntimeLibraryVersionToReleased = compilerVersion == null)
|
||||
}
|
||||
|
||||
if (shouldInferAPILevel) {
|
||||
apiLevel = if (useProjectSettings) {
|
||||
LanguageVersion.fromVersionString(commonArguments.apiVersion) ?: languageLevel
|
||||
} else {
|
||||
languageLevel!!.coerceAtMost(getLibraryLanguageLevel(module, rootModel, targetPlatformKind))
|
||||
languageLevel!!.coerceAtMost(
|
||||
getLibraryLanguageLevel(
|
||||
module,
|
||||
rootModel,
|
||||
targetPlatformKind,
|
||||
coerceRuntimeLibraryVersionToReleased = compilerVersion == null
|
||||
)
|
||||
)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user