Allow pre-release compiler reading pre-release binaries in tests
Pre-release compiler should be able to read pre-release binaries in tests even if a stable language version is used, otherwise no stdlib API can be read.
This commit is contained in:
+1
-1
@@ -34,7 +34,7 @@ data class CompilerTestLanguageVersionSettings(
|
|||||||
override fun getFeatureSupport(feature: LanguageFeature): LanguageFeature.State =
|
override fun getFeatureSupport(feature: LanguageFeature): LanguageFeature.State =
|
||||||
languageFeatures[feature] ?: delegate.getFeatureSupport(feature)
|
languageFeatures[feature] ?: delegate.getFeatureSupport(feature)
|
||||||
|
|
||||||
override fun isPreRelease(): Boolean = languageVersion.isPreRelease()
|
override fun isPreRelease(): Boolean = KotlinCompilerVersion.isPreRelease()
|
||||||
|
|
||||||
@Suppress("UNCHECKED_CAST")
|
@Suppress("UNCHECKED_CAST")
|
||||||
override fun <T> getFlag(flag: AnalysisFlag<T>): T = analysisFlags[flag] as T? ?: flag.defaultValue
|
override fun <T> getFlag(flag: AnalysisFlag<T>): T = analysisFlags[flag] as T? ?: flag.defaultValue
|
||||||
|
|||||||
@@ -18,6 +18,7 @@ package org.jetbrains.kotlin.codegen
|
|||||||
|
|
||||||
import org.jetbrains.kotlin.cli.jvm.K2JVMCompiler
|
import org.jetbrains.kotlin.cli.jvm.K2JVMCompiler
|
||||||
import org.jetbrains.kotlin.config.ApiVersion
|
import org.jetbrains.kotlin.config.ApiVersion
|
||||||
|
import org.jetbrains.kotlin.config.KotlinCompilerVersion
|
||||||
import org.jetbrains.kotlin.config.LanguageVersion
|
import org.jetbrains.kotlin.config.LanguageVersion
|
||||||
import org.jetbrains.kotlin.config.LanguageVersionSettingsImpl
|
import org.jetbrains.kotlin.config.LanguageVersionSettingsImpl
|
||||||
import org.jetbrains.kotlin.load.kotlin.loadModuleMapping
|
import org.jetbrains.kotlin.load.kotlin.loadModuleMapping
|
||||||
@@ -44,7 +45,7 @@ class JvmModuleProtoBufTest : KtUsefulTestCase() {
|
|||||||
"-d", tmpdir.path,
|
"-d", tmpdir.path,
|
||||||
"-module-name", moduleName,
|
"-module-name", moduleName,
|
||||||
"-language-version", compileWith.versionString
|
"-language-version", compileWith.versionString
|
||||||
) + extraOptions)
|
) + extraOptions + listOfNotNull("-Xskip-metadata-version-check".takeIf { KotlinCompilerVersion.isPreRelease() }))
|
||||||
|
|
||||||
val mapping = ModuleMapping.loadModuleMapping(
|
val mapping = ModuleMapping.loadModuleMapping(
|
||||||
File(tmpdir, "META-INF/$moduleName.${ModuleMapping.MAPPING_FILE_EXT}").readBytes(), "test",
|
File(tmpdir, "META-INF/$moduleName.${ModuleMapping.MAPPING_FILE_EXT}").readBytes(), "test",
|
||||||
|
|||||||
Reference in New Issue
Block a user