You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Type-use nullability annotations on a nested type need to be written on the inner-most type (so instead of writing @Nullable A.B, write A.@Nullable B; see here). Consider this example:
This example currently passes NullAway, but on the JSpecify reference checker yields an error:
SampleQualified.java:12: error: [nullness] illegal location for annotation: outer types are always non-null. To annotate the inner type, write `Foo.@Nullable Bar` instead of `@Nullable Foo.Bar`.
@Nullable A.B f;
^
1 error
As part of #708, we should update NullAway to also require that type-use annotations be written in the correct location for nested types, and issue an error otherwise. This new treatment should be applied independent of the JSpecifyMode flag. The previous treatment of type-use annotations should be preserved if the LegacyAnnotationLocations flag is set to true. And a declaration @Nullable annotation should continue to be treated as applying to the inner-most type (whether the JSpecifyMode flag is set or not).
The text was updated successfully, but these errors were encountered:
Type-use nullability annotations on a nested type need to be written on the inner-most type (so instead of writing
@Nullable A.B
, writeA.@Nullable B
; see here). Consider this example:This example currently passes NullAway, but on the JSpecify reference checker yields an error:
As part of #708, we should update NullAway to also require that type-use annotations be written in the correct location for nested types, and issue an error otherwise. This new treatment should be applied independent of the
JSpecifyMode
flag. The previous treatment of type-use annotations should be preserved if theLegacyAnnotationLocations
flag is set to true. And a declaration@Nullable
annotation should continue to be treated as applying to the inner-most type (whether theJSpecifyMode
flag is set or not).The text was updated successfully, but these errors were encountered: