Fix warnings after update to 202 platform
#KT-44069 Fixed
This commit is contained in:
@@ -5,6 +5,7 @@
|
||||
|
||||
package org.jetbrains.kotlin.codegen
|
||||
|
||||
@Suppress("UNUSED_PARAMETER", "unused")
|
||||
fun ClassBuilder.addRecordComponent(name: String, desc: String, signature: String?) {
|
||||
// newRecordComponent(name, desc, signature)
|
||||
}
|
||||
|
||||
+1
-2
@@ -17,7 +17,6 @@
|
||||
package org.jetbrains.kotlin.codegen
|
||||
|
||||
import com.intellij.psi.PsiElement
|
||||
import com.intellij.util.containers.LinkedMultiMap
|
||||
import com.intellij.util.containers.MultiMap
|
||||
import org.jetbrains.kotlin.codegen.state.JvmMethodExceptionTypes
|
||||
import org.jetbrains.kotlin.resolve.jvm.diagnostics.ConflictingJvmDeclarationsData
|
||||
@@ -49,7 +48,7 @@ abstract class SignatureCollectingClassBuilderFactory(
|
||||
|
||||
private lateinit var classInternalName: String
|
||||
|
||||
private val signatures = LinkedMultiMap<RawSignature, JvmDeclarationOrigin>()
|
||||
private val signatures = MultiMap.createLinked<RawSignature, JvmDeclarationOrigin>()
|
||||
|
||||
override fun defineClass(origin: PsiElement?, version: Int, access: Int, name: String, signature: String?, superName: String, interfaces: Array<out String>) {
|
||||
classInternalName = name
|
||||
|
||||
@@ -137,7 +137,8 @@ abstract class DefaultLambda(
|
||||
override val isSuspend = parameterDescriptor.isSuspendLambda
|
||||
|
||||
override fun generateLambdaBody(sourceCompiler: SourceCompilerForInline, reifiedTypeInliner: ReifiedTypeInliner<*>) {
|
||||
val classReader = buildClassReaderByInternalName(sourceCompiler.state, lambdaClassType.internalName)
|
||||
val classBytes = loadClassBytesByInternalName(sourceCompiler.state, lambdaClassType.internalName)
|
||||
val classReader = ClassReader(classBytes)
|
||||
var isPropertyReference = false
|
||||
var isFunctionReference = false
|
||||
classReader.accept(object : ClassVisitor(Opcodes.API_VERSION) {
|
||||
@@ -162,12 +163,7 @@ abstract class DefaultLambda(
|
||||
}
|
||||
|
||||
val descriptor = Type.getMethodDescriptor(Type.VOID_TYPE, *capturedArgs)
|
||||
val constructor = getMethodNode(
|
||||
classReader.b,
|
||||
"<init>",
|
||||
descriptor,
|
||||
lambdaClassType
|
||||
)?.node
|
||||
val constructor = getMethodNode(classBytes, "<init>", descriptor, lambdaClassType)?.node
|
||||
|
||||
assert(constructor != null || capturedArgs.isEmpty()) {
|
||||
"Can't find non-default constructor <init>$descriptor for default lambda $lambdaClassType"
|
||||
@@ -190,13 +186,8 @@ abstract class DefaultLambda(
|
||||
|
||||
val signature = mapAsmSignature(sourceCompiler)
|
||||
|
||||
node = getMethodNode(
|
||||
classReader.b,
|
||||
methodName,
|
||||
signature.descriptor,
|
||||
lambdaClassType,
|
||||
signatureAmbiguity = true
|
||||
) ?: error("Can't find method '$methodName$signature' in '${classReader.className}'")
|
||||
node = getMethodNode(classBytes, methodName, signature.descriptor, lambdaClassType, signatureAmbiguity = true)
|
||||
?: error("Can't find method '$methodName$signature' in '${classReader.className}'")
|
||||
|
||||
invokeMethod = Method(node.node.name, node.node.desc)
|
||||
|
||||
|
||||
@@ -46,9 +46,8 @@ abstract class ObjectTransformer<out T : TransformationInfo>(@JvmField val trans
|
||||
)
|
||||
}
|
||||
|
||||
fun createClassReader(): ClassReader {
|
||||
return buildClassReaderByInternalName(state, transformationInfo.oldClassName)
|
||||
}
|
||||
fun createClassReader(): ClassReader =
|
||||
ClassReader(loadClassBytesByInternalName(state, transformationInfo.oldClassName))
|
||||
}
|
||||
|
||||
class WhenMappingTransformer(
|
||||
|
||||
@@ -346,16 +346,16 @@ internal val AbstractInsnNode?.insnText: String
|
||||
internal val AbstractInsnNode?.insnOpcodeText: String
|
||||
get() = if (this == null) "null" else Printer.OPCODES[opcode]
|
||||
|
||||
internal fun buildClassReaderByInternalName(state: GenerationState, internalName: String): ClassReader {
|
||||
internal fun loadClassBytesByInternalName(state: GenerationState, internalName: String): ByteArray {
|
||||
//try to find just compiled classes then in dependencies
|
||||
val outputFile = state.factory.get(internalName + ".class")
|
||||
val outputFile = state.factory.get("$internalName.class")
|
||||
if (outputFile != null) {
|
||||
return ClassReader(outputFile.asByteArray())
|
||||
return outputFile.asByteArray()
|
||||
}
|
||||
|
||||
val file = findVirtualFileImprecise(state, internalName) ?: throw RuntimeException("Couldn't find virtual file for " + internalName)
|
||||
val file = findVirtualFileImprecise(state, internalName) ?: throw RuntimeException("Couldn't find virtual file for $internalName")
|
||||
|
||||
return ClassReader(file.contentsToByteArray())
|
||||
return file.contentsToByteArray()
|
||||
}
|
||||
|
||||
fun generateFinallyMarker(v: InstructionAdapter, depth: Int, start: Boolean) {
|
||||
|
||||
Reference in New Issue
Block a user