[Infer] Better error message for warnings based on @Nullable

Summary: Make confusing error message in complicated case where @Nullable-annotated object flows to an object without an annotation a bit clearer.
master
Sam Blackshear 10 years ago
parent 0946c9e460
commit 14c41278e6

@ -403,8 +403,8 @@ let dereference_string deref_str value_str access_opt loc =
let problem_str =
match Tags.get !tags Tags.nullable_src with
| Some nullable_src ->
if nullable_src = value_str then "is annotated with @Nullable and is dereferenced"
else "may hold @Nullable-annotated object " ^ nullable_src ^ " and is dereferenced"
if nullable_src = value_str then "is annotated with @Nullable and is dereferenced without a null check"
else "is indirectly marked @Nullable (source: " ^ nullable_src ^ ") and is dereferenced without a null check"
| None -> deref_str.problem_str in
[(problem_str ^ " " ^ at_line tags loc)] in
value_desc:: access_desc @ problem_desc, None, !tags

Loading…
Cancel
Save