Prechádzať zdrojové kódy

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

Simon Krajewski 8 rokov pred
rodič
commit
9bbefffbdb

+ 3 - 2
src/typing/matcher.ml

@@ -271,8 +271,9 @@ module Pattern = struct
 					in
 					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
 					end;
 					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