Browse Source

Always check var shadowing, disable associated warning by default

Rudy Ges 6 tháng trước cách đây
mục cha
commit
670ecdacdb
2 tập tin đã thay đổi với 3 bổ sung2 xóa
  1. 2 1
      src-json/warning.json
  2. 1 1
      src/context/typecore.ml

+ 2 - 1
src-json/warning.json

@@ -76,7 +76,8 @@
 	{
 		"name": "WVarShadow",
 		"doc": "A local variable hides another by using the same name",
-		"parent": "WTyper"
+		"parent": "WTyper",
+		"enabled": false
 	},
 	{
 		"name": "WExternWithExpr",

+ 1 - 1
src/context/typecore.ml

@@ -416,7 +416,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 && n <> "_" then begin
+	if n <> "_" then begin
 		match k with
 		| VUser _ ->
 			begin try