JVM_IR: Do not generate annotations on $default methods.

This commit is contained in:
Mads Ager
2019-02-19 13:18:25 +01:00
committed by max-kammerer
parent 19d2bac2f8
commit e9ec8e2cee
2 changed files with 4 additions and 3 deletions
@@ -46,8 +46,10 @@ open class FunctionCodegen(private val irFunction: IrFunction, private val class
val flags = calculateMethodFlags(irFunction.isStatic)
val methodVisitor = createMethod(flags, signature)
AnnotationCodegen.forMethod(methodVisitor, classCodegen, state).genAnnotations(descriptor, signature.asmMethod.returnType)
FunctionCodegen.generateParameterAnnotations(descriptor, methodVisitor, signature, classCodegen, state)
if (irFunction.origin != IrDeclarationOrigin.FUNCTION_FOR_DEFAULT_PARAMETER) {
AnnotationCodegen.forMethod(methodVisitor, classCodegen, state).genAnnotations(descriptor, signature.asmMethod.returnType)
FunctionCodegen.generateParameterAnnotations(descriptor, methodVisitor, signature, classCodegen, state)
}
if (!state.classBuilderMode.generateBodies || flags.and(Opcodes.ACC_ABSTRACT) != 0 || irFunction.isExternal) {
generateAnnotationDefaultValueIfNeeded(methodVisitor)
@@ -1,5 +1,4 @@
// TARGET_BACKEND: JVM
// IGNORE_BACKEND: JVM_IR
// WITH_RUNTIME
import kotlin.test.assertEquals