Do not write pre-release binaries for stable LV

This commit reverts f6571effcc and
reimplements the desired logic in another way.

In particular, we'd like these two conditions to hold:
1) only the release compiler with stable language settings (meaning,
   language version is a released version of Kotlin and no experimental
   features are enabled) should report errors when _reading_ pre-release
   binaries.
2) the compiler should _write_ pre-release binaries only if language
   settings are not stable, independent of whether the compiler itself
   is release or not.

From these conditions it follows that we must use different logic to
determine how to behave when reading/writing pre-release binaries.
Namely, reading (in CompilerDeserializationConfiguration) now checks if
both the compiler is release and the language settings are stable, and
writing (in LanguageVersionSettings.isPreRelease) checks only that the
language settings are stable
This commit is contained in:
Alexander Udalov
2018-08-23 16:46:26 +02:00
parent 053a4b714c
commit 475a80b641
3 changed files with 30 additions and 3 deletions
@@ -271,7 +271,7 @@ class LanguageVersionSettingsImpl @JvmOverloads constructor(
}
}
override fun isPreRelease(): Boolean = KotlinCompilerVersion.isPreRelease() ||
override fun isPreRelease(): Boolean = languageVersion.isPreRelease() ||
specificFeatures.any { (feature, state) ->
state == LanguageFeature.State.ENABLED && feature.forcesPreReleaseBinariesIfEnabled()
}