JVM: don't generate nullability annotations on property delegate fields

Such fields are private, so these annotations are redundant.

They were incorrect, anyway (property type was used instead of delegate
type).
This commit is contained in:
Dmitry Petrov
2020-06-23 16:56:23 +03:00
parent af3bda51ec
commit 5bfec7f6bc
2 changed files with 4 additions and 2 deletions
@@ -196,7 +196,9 @@ public abstract class AnnotationCodegen {
return;
}
if (returnType != null && !AsmUtil.isPrimitive(returnType)) {
if (returnType != null && !AsmUtil.isPrimitive(returnType) &&
!(descriptor instanceof PropertyDescriptor && ((PropertyDescriptor) descriptor).isDelegated())
) {
generateNullabilityAnnotation(descriptor.getReturnType(), annotationDescriptorsAlreadyPresent);
}
}