|
@@ -202,8 +202,11 @@ let add_local ctx k n t p =
|
|
|
if Define.defined ctx.com.defines Define.WarnVarShadowing && n <> "_" then begin
|
|
|
try
|
|
|
let v' = PMap.find n ctx.locals in
|
|
|
- ctx.com.warning "This variable shadows a previously declared variable" p;
|
|
|
- ctx.com.warning "Previous variable was here" v'.v_pos
|
|
|
+ (* ignore std lib *)
|
|
|
+ if not (List.exists (ExtLib.String.starts_with p.pfile) ctx.com.std_path) then begin
|
|
|
+ ctx.com.warning "This variable shadows a previously declared variable" p;
|
|
|
+ ctx.com.warning "Previous variable was here" v'.v_pos
|
|
|
+ end
|
|
|
with Not_found ->
|
|
|
()
|
|
|
end;
|