Browse Source

don't complain about var shadowing on `_` #8041

Aleksandr Kuzmenko 6 years ago
parent
commit
69d8050616
1 changed files with 1 additions and 1 deletions
  1. 1 1
      src/context/typecore.ml

+ 1 - 1
src/context/typecore.ml

@@ -199,7 +199,7 @@ let save_locals ctx =
 
 let add_local ctx k n t p =
 	let v = alloc_var k n t p in
-	if Define.defined ctx.com.defines Define.WarnVarShadowing then begin
+	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;