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
@@ -28,7 +28,7 @@ import org.jetbrains.kotlin.idea.decompiler.textBuilder.DecompiledText
import org.jetbrains.kotlin.idea.decompiler.textBuilder.ResolverForDecompiler
import org.jetbrains.kotlin.idea.decompiler.textBuilder.buildDecompiledText
import org.jetbrains.kotlin.idea.decompiler.textBuilder.defaultDecompilerRendererOptions
import org.jetbrains.kotlin.load.java.JvmBytecodeBinaryVersion
import org.jetbrains.kotlin.load.kotlin.JvmMetadataVersion
import org.jetbrains.kotlin.load.kotlin.header.KotlinClassHeader
import org.jetbrains.kotlin.renderer.DescriptorRenderer
import org.jetbrains.kotlin.types.flexibility
@@ -83,7 +83,7 @@ fun buildDecompiledTextForClassFile(
if (!classHeader.metadataVersion.isCompatible()) {
return DecompiledText(
INCOMPATIBLE_ABI_VERSION_COMMENT
.replace(CURRENT_ABI_VERSION_MARKER, JvmBytecodeBinaryVersion.INSTANCE.toString())
.replace(CURRENT_ABI_VERSION_MARKER, JvmMetadataVersion.INSTANCE.toString())
.replace(FILE_ABI_VERSION_MARKER, classHeader.metadataVersion.toString()),
mapOf()
)
@@ -36,7 +36,7 @@ class LoggingErrorReporter(private val log: Logger) : ErrorReporter {
log.error("Could not infer visibility for $descriptor")
}
override fun reportIncompatibleAbiVersion(classId: ClassId, filePath: String, actualVersion: BinaryVersion) {
override fun reportIncompatibleMetadataVersion(classId: ClassId, filePath: String, actualVersion: BinaryVersion) {
log.error("Incompatible ABI version for class $classId, actual version: $actualVersion")
}
}