Report pre-release errors if release LV is used

#KT-21267 Fixed
This commit is contained in:
Alexander Udalov
2017-11-15 12:50:23 +01:00
parent 64a8008a8a
commit d386712903
15 changed files with 80 additions and 26 deletions
@@ -16,7 +16,6 @@
package org.jetbrains.kotlin.load.kotlin
import org.jetbrains.kotlin.config.KotlinCompilerVersion
import org.jetbrains.kotlin.descriptors.ClassDescriptor
import org.jetbrains.kotlin.descriptors.PackageFragmentDescriptor
import org.jetbrains.kotlin.load.kotlin.header.KotlinClassHeader
@@ -75,9 +74,12 @@ class DeserializedDescriptorResolver {
return IncompatibleVersionErrorData(classHeader.metadataVersion, JvmMetadataVersion.INSTANCE, location, classId)
}
/**
* @return true if the class is invisible because it's compiled by a pre-release compiler, and this compiler is either released
* or is run with a released language version.
*/
private val KotlinJvmBinaryClass.isPreReleaseInvisible: Boolean
get() = !components.configuration.skipPreReleaseCheck &&
!KotlinCompilerVersion.isPreRelease() &&
get() = components.configuration.reportErrorsOnPreReleaseDependencies &&
(classHeader.isPreRelease || classHeader.metadataVersion == KOTLIN_1_1_EAP_METADATA_VERSION)
internal fun readData(kotlinClass: KotlinJvmBinaryClass, expectedKinds: Set<KotlinClassHeader.Kind>): Array<String>? {
@@ -20,7 +20,7 @@ interface DeserializationConfiguration {
val skipMetadataVersionCheck: Boolean
get() = false
val skipPreReleaseCheck: Boolean
val reportErrorsOnPreReleaseDependencies: Boolean
get() = false
val typeAliasesAllowed: Boolean