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 {
// 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)
}
@@ -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(