JVM_IR: no annotations on parameters of 'property$annotations' methods
This commit is contained in:
+13
-3
@@ -86,9 +86,7 @@ class FunctionCodegen(
|
|||||||
)
|
)
|
||||||
}
|
}
|
||||||
}.genAnnotations(irFunction, signature.asmMethod.returnType, irFunction.returnType)
|
}.genAnnotations(irFunction, signature.asmMethod.returnType, irFunction.returnType)
|
||||||
// Not generating parameter annotations for default stubs fixes KT-7892, though
|
if (shouldGenerateAnnotationsOnValueParameters()) {
|
||||||
// this certainly looks like a workaround for a javac bug.
|
|
||||||
if (irFunction !is IrConstructor || !irFunction.parentAsClass.shouldNotGenerateConstructorParameterAnnotations()) {
|
|
||||||
generateParameterAnnotations(irFunction, methodVisitor, signature, classCodegen, context, skipNullabilityAnnotations)
|
generateParameterAnnotations(irFunction, methodVisitor, signature, classCodegen, context, skipNullabilityAnnotations)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -120,6 +118,18 @@ class FunctionCodegen(
|
|||||||
return SMAPAndMethodNode(methodNode, smap)
|
return SMAPAndMethodNode(methodNode, smap)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private fun shouldGenerateAnnotationsOnValueParameters(): Boolean =
|
||||||
|
when {
|
||||||
|
irFunction.origin == JvmLoweredDeclarationOrigin.SYNTHETIC_METHOD_FOR_PROPERTY_ANNOTATIONS ->
|
||||||
|
false
|
||||||
|
irFunction is IrConstructor && irFunction.parentAsClass.shouldNotGenerateConstructorParameterAnnotations() ->
|
||||||
|
// Not generating parameter annotations for default stubs fixes KT-7892, though
|
||||||
|
// this certainly looks like a workaround for a javac bug.
|
||||||
|
false
|
||||||
|
else ->
|
||||||
|
true
|
||||||
|
}
|
||||||
|
|
||||||
// Since the only arguments to anonymous object constructors are captured variables and complex
|
// Since the only arguments to anonymous object constructors are captured variables and complex
|
||||||
// super constructor arguments, there shouldn't be any annotations on them other than @NonNull,
|
// super constructor arguments, there shouldn't be any annotations on them other than @NonNull,
|
||||||
// and those are meaningless on synthetic parameters. (Also, the inliner cannot handle them and
|
// and those are meaningless on synthetic parameters. (Also, the inliner cannot handle them and
|
||||||
|
|||||||
Reference in New Issue
Block a user