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:
@@ -196,7 +196,9 @@ public abstract class AnnotationCodegen {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (returnType != null && !AsmUtil.isPrimitive(returnType)) {
|
if (returnType != null && !AsmUtil.isPrimitive(returnType) &&
|
||||||
|
!(descriptor instanceof PropertyDescriptor && ((PropertyDescriptor) descriptor).isDelegated())
|
||||||
|
) {
|
||||||
generateNullabilityAnnotation(descriptor.getReturnType(), annotationDescriptorsAlreadyPresent);
|
generateNullabilityAnnotation(descriptor.getReturnType(), annotationDescriptorsAlreadyPresent);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
public final class A {
|
public final class A {
|
||||||
synthetic final static field $$delegatedProperties: kotlin.reflect.KProperty[]
|
synthetic final static field $$delegatedProperties: kotlin.reflect.KProperty[]
|
||||||
private @AnnField field p: int
|
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 final @AnnField field x: int
|
||||||
private field y: int
|
private field y: int
|
||||||
static method <clinit>(): void
|
static method <clinit>(): void
|
||||||
|
|||||||
Reference in New Issue
Block a user