Hi John,
re 1) In this example you have:
public @Nullable @m Float[] test(final String param) {
if (param.equals("foo")) {
return null;
}
The Units Checker is not complaining about this, but the Nullness
Checker gives you the correct error:
Error: [return.type.incompatible] incompatible types in return.
found : null
required: @Initialized @Nullable Float @Initialized @NonNull []
You probably meant `@m Float @Nullable []` as the return type. You
want to express that the method returns a possibly null array of @m
Float objects.
So you need to put the @Nullable in front of the array and the @m in
front of the component type.
The error message tries to highlight this by showing the `@NonNull []`
array type.
Does this make sense now?
re 2) Thanks for letting us know about the restriction with inner
static classes. I've filed
https://github.com/typetools/checker-framework/issues/2090 to look
into fixing this.
However, when I change your example to use top-level classes, I do not
get an error from the Units Checker about the return null.
Can you reproduce the original problem
https://github.com/typetools/checker-framework/issues/2087 with
top-level classes?
Best,
cu, WMD.
>>>> To unsubscribe from this group and stop receiving emails from it, send an email to
checker-framework-...@googlegroups.com.
> --
>
> ---
> You received this message because you are subscribed to the Google Groups "Checker Framework discussion" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to
checker-framework-...@googlegroups.com.
http://www.google.com/profiles/wdietl