Account for fields annotated @NotNull

This commit is contained in:
Andrey Breslav
2013-10-30 15:36:01 +04:00
parent 645b878ac2
commit 3f3030ff26
2 changed files with 2 additions and 2 deletions
@@ -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)
} }
@@ -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(