Use JvmMetadataVersion where appropriate instead of bytecode version

This commit is contained in:
Alexander Udalov
2016-01-13 21:24:20 +03:00
parent bd47e9d47b
commit b587d3a78d
19 changed files with 65 additions and 56 deletions
@@ -18,7 +18,7 @@ package org.jetbrains.kotlin.load.java.components
import org.jetbrains.kotlin.descriptors.CallableMemberDescriptor
import org.jetbrains.kotlin.descriptors.ClassDescriptor
import org.jetbrains.kotlin.load.java.JvmBytecodeBinaryVersion
import org.jetbrains.kotlin.load.kotlin.JvmMetadataVersion
import org.jetbrains.kotlin.name.ClassId
import org.jetbrains.kotlin.serialization.deserialization.BinaryVersion
import org.jetbrains.kotlin.serialization.deserialization.ErrorReporter
@@ -29,14 +29,14 @@ object RuntimeErrorReporter : ErrorReporter {
throw IllegalStateException("Incomplete hierarchy for class ${descriptor.name}, unresolved classes $unresolvedSuperClasses")
}
override fun reportIncompatibleAbiVersion(classId: ClassId, filePath: String, actualVersion: BinaryVersion) {
throw IllegalStateException("Incompatible ABI version of $classId: $actualVersion " +
"(expected version is ${JvmBytecodeBinaryVersion.INSTANCE})")
override fun reportIncompatibleMetadataVersion(classId: ClassId, filePath: String, actualVersion: BinaryVersion) {
throw IllegalStateException("Incompatible binary version of $classId: $actualVersion " +
"(expected version is ${JvmMetadataVersion.INSTANCE})")
}
override fun reportCannotInferVisibility(descriptor: CallableMemberDescriptor) {
// TODO: use DescriptorRenderer
throw IllegalStateException("Cannot infer visibility for class ${descriptor.name}")
throw IllegalStateException("Cannot infer visibility for $descriptor")
}
override fun reportLoadingError(message: String, exception: Exception?) {