Use JvmMetadataVersion where appropriate instead of bytecode version
This commit is contained in:
+2
-2
@@ -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()
|
||||
)
|
||||
|
||||
+1
-1
@@ -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")
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user