Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[warnings] use -w instead of defines #12013

Merged
merged 2 commits into from
Feb 16, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions src-json/define.json
Original file line number Diff line number Diff line change
Expand Up @@ -554,7 +554,8 @@
{
"name": "NoDeprecationWarnings",
"define": "no-deprecation-warnings",
"doc": "Do not warn if fields annotated with `@:deprecated` are used."
"doc": "Do not warn if fields annotated with `@:deprecated` are used.",
"deprecated": "Use -w to configure warnings. See https://haxe.org/manual/cr-warnings.html for more information."
},
{
"name": "NoFlashOverride",
Expand Down Expand Up @@ -791,7 +792,8 @@
{
"name": "WarnVarShadowing",
"define": "warn-var-shadowing",
"doc": "Warn about shadowing variable declarations."
"doc": "Warn about shadowing variable declarations.",
"deprecated": "Use -w to configure warnings. See https://haxe.org/manual/cr-warnings.html for more information."
},
{
"name": "NoTre",
Expand Down
3 changes: 2 additions & 1 deletion src-json/warning.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
2 changes: 1 addition & 1 deletion src/context/typecore.ml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Loading