diff --git a/compiler/backend/src/org/jetbrains/kotlin/codegen/AnnotationCodegen.java b/compiler/backend/src/org/jetbrains/kotlin/codegen/AnnotationCodegen.java index 2f09b54f99a..05218e42925 100644 --- a/compiler/backend/src/org/jetbrains/kotlin/codegen/AnnotationCodegen.java +++ b/compiler/backend/src/org/jetbrains/kotlin/codegen/AnnotationCodegen.java @@ -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); } } diff --git a/compiler/testData/codegen/bytecodeListing/annotations/onProperties.txt b/compiler/testData/codegen/bytecodeListing/annotations/onProperties.txt index 6c0a8159bad..0b23689f3a7 100644 --- a/compiler/testData/codegen/bytecodeListing/annotations/onProperties.txt +++ b/compiler/testData/codegen/bytecodeListing/annotations/onProperties.txt @@ -2,7 +2,7 @@ public final class A { synthetic final static field $$delegatedProperties: kotlin.reflect.KProperty[] private @AnnField field p: int - private final @AnnDelegate @org.jetbrains.annotations.NotNull field s$delegate: CustomDelegate + private final @AnnDelegate field s$delegate: CustomDelegate private final @AnnField field x: int private field y: int static method (): void