diff --git a/compiler/ir/backend.jvm/src/org/jetbrains/kotlin/backend/jvm/codegen/FunctionCodegen.kt b/compiler/ir/backend.jvm/src/org/jetbrains/kotlin/backend/jvm/codegen/FunctionCodegen.kt index 6a9370f1b4e..bd4ca54e47e 100644 --- a/compiler/ir/backend.jvm/src/org/jetbrains/kotlin/backend/jvm/codegen/FunctionCodegen.kt +++ b/compiler/ir/backend.jvm/src/org/jetbrains/kotlin/backend/jvm/codegen/FunctionCodegen.kt @@ -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) diff --git a/compiler/testData/codegen/box/annotations/annotationsOnDefault.kt b/compiler/testData/codegen/box/annotations/annotationsOnDefault.kt index 86ade324d23..2c6f768f86d 100644 --- a/compiler/testData/codegen/box/annotations/annotationsOnDefault.kt +++ b/compiler/testData/codegen/box/annotations/annotationsOnDefault.kt @@ -1,5 +1,4 @@ // TARGET_BACKEND: JVM -// IGNORE_BACKEND: JVM_IR // WITH_RUNTIME import kotlin.test.assertEquals