diff options
-rw-r--r-- | NEWS | 1 | ||||
-rw-r--r-- | src/global_checks.ml | 2 |
2 files changed, 2 insertions, 1 deletions
@@ -1,3 +1,4 @@ +- fix "undeclared variable $_" false positive on List::Util::first() - fake packages: o add Gtk3 & Gtk3::{Notify,WebKit} diff --git a/src/global_checks.ml b/src/global_checks.ml index 0140c44..b2c2a3e 100644 --- a/src/global_checks.ml +++ b/src/global_checks.ml @@ -285,7 +285,7 @@ let check_variables vars t = Some vars | Call(Deref(I_func, Ident(None, func, func_pos)), Anonymous_sub(_, Block f, pos) :: l) - when List.mem func [ "grep" ; "map" ; "substInFile" ; "map_index" ; "each_index" ; "partition" ; "find_index" ; "grep_index" ; "find" ; "any" ; "every" ; "uniq_" ] -> + when List.mem func [ "grep" ; "map" ; "substInFile" ; "map_index" ; "each_index" ; "partition" ; "find_index" ; "grep_index" ; "find" ; "first" ; "any" ; "every" ; "uniq_" ] -> let vars = List.fold_left check_variables_ vars l in let vars' = { vars with my_vars = [] :: vars.my_vars ; our_vars = [(I_scalar, "_"), (pos, ref Access_various, None)] :: vars.our_vars } in let vars' = List.fold_left check_variables_ vars' f in |