Browse Source

[matcher] disable toplevel `case x` warning for now (see #6207)

Simon Krajewski 8 years ago
parent
commit
9bbefffbdb
2 changed files with 4 additions and 4 deletions
  1. 3 2
      src/typing/matcher.ml
  2. 1 2
      tests/misc/projects/Issue4907/compile-fail.hxml.stderr

+ 3 - 2
src/typing/matcher.ml

@@ -271,8 +271,9 @@ module Pattern = struct
 					in
 					in
 					begin match StringError.get_similar s sl with
 					begin match StringError.get_similar s sl with
 						| [] ->
 						| [] ->
-							if toplevel then
-								pctx.ctx.com.warning (Printf.sprintf "`case %s` has been deprecated, use `case var %s` instead" s s) p
+							()
+							(* if toplevel then
+								pctx.ctx.com.warning (Printf.sprintf "`case %s` has been deprecated, use `case var %s` instead" s s) p *)
 						| l -> pctx.ctx.com.warning ("Potential typo detected (expected similar values are " ^ (String.concat ", " l) ^ "). Consider using `var " ^ s ^ "` instead") p
 						| l -> pctx.ctx.com.warning ("Potential typo detected (expected similar values are " ^ (String.concat ", " l) ^ "). Consider using `var " ^ s ^ "` instead") p
 					end;
 					end;
 					let v = add_local s p in
 					let v = add_local s p in

+ 1 - 2
tests/misc/projects/Issue4907/compile-fail.hxml.stderr

@@ -1,2 +1 @@
-Main.hx:7: characters 18-23 : Capture variables must be lower-case
-Main.hx:7: characters 18-23 : Warning : `case VALUE` has been deprecated, use `case var VALUE` instead
+Main.hx:7: characters 18-23 : Capture variables must be lower-case