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 {
|
private fun getPropertyType(field: JavaField): JetType {
|
||||||
// Fields do not have their own generic parameters
|
// 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)) {
|
if (JavaPropertyResolver.isStaticFinalField(field)) {
|
||||||
return TypeUtils.makeNotNullable(propertyType)
|
return TypeUtils.makeNotNullable(propertyType)
|
||||||
}
|
}
|
||||||
|
|||||||
+1
-1
@@ -265,7 +265,7 @@ class LazyJavaTypeAttributes(
|
|||||||
c: LazyJavaResolverContext,
|
c: LazyJavaResolverContext,
|
||||||
val annotationOwner: JavaAnnotationOwner,
|
val annotationOwner: JavaAnnotationOwner,
|
||||||
override val howThisTypeIsUsed: TypeUsage,
|
override val howThisTypeIsUsed: TypeUsage,
|
||||||
computeHowThisTypeIsUsedAccrodingToAnnotations: () -> TypeUsage
|
computeHowThisTypeIsUsedAccrodingToAnnotations: () -> TypeUsage = {howThisTypeIsUsed}
|
||||||
): JavaTypeAttributes {
|
): JavaTypeAttributes {
|
||||||
|
|
||||||
override val howThisTypeIsUsedAccordingToAnnotations: TypeUsage by c.storageManager.createLazyValue(
|
override val howThisTypeIsUsedAccordingToAnnotations: TypeUsage by c.storageManager.createLazyValue(
|
||||||
|
|||||||
Reference in New Issue
Block a user