Account for fields annotated @NotNull
This commit is contained in:
+1
-1
@@ -252,7 +252,7 @@ public abstract class LazyJavaMemberScope(
|
||||
|
||||
private fun getPropertyType(field: JavaField): JetType {
|
||||
// Fields do not have their own generic parameters
|
||||
val propertyType = c.typeResolver.transformJavaType(field.getType(), TypeUsage.MEMBER_SIGNATURE_INVARIANT.toAttributes())
|
||||
val propertyType = c.typeResolver.transformJavaType(field.getType(), LazyJavaTypeAttributes(c, field, TypeUsage.MEMBER_SIGNATURE_INVARIANT))
|
||||
if (JavaPropertyResolver.isStaticFinalField(field)) {
|
||||
return TypeUtils.makeNotNullable(propertyType)
|
||||
}
|
||||
|
||||
+1
-1
@@ -265,7 +265,7 @@ class LazyJavaTypeAttributes(
|
||||
c: LazyJavaResolverContext,
|
||||
val annotationOwner: JavaAnnotationOwner,
|
||||
override val howThisTypeIsUsed: TypeUsage,
|
||||
computeHowThisTypeIsUsedAccrodingToAnnotations: () -> TypeUsage
|
||||
computeHowThisTypeIsUsedAccrodingToAnnotations: () -> TypeUsage = {howThisTypeIsUsed}
|
||||
): JavaTypeAttributes {
|
||||
|
||||
override val howThisTypeIsUsedAccordingToAnnotations: TypeUsage by c.storageManager.createLazyValue(
|
||||
|
||||
Reference in New Issue
Block a user