Skip to content

Commit

Permalink
Clarify implicit-global warning message
Browse files Browse the repository at this point in the history
"if creating a global was intended" might imply that a global was not created
  • Loading branch information
Sainan authored and well-in-that-case committed Nov 2, 2024
1 parent 1f6aa5e commit d07edbe
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/lparser.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1898,7 +1898,7 @@ static void check_assignment (LexState *ls, const expdesc *v) {
luaX_prev(ls);
TString *name = str_checkname(ls, N_RESERVED_NON_VALUE | N_OVERRIDABLE);
if (ls->explicit_globals.count(name) == 0) {
throw_warn(ls, "implicit global creation", "prefix this with 'global' if creating a global was intended", WT_IMPLICIT_GLOBAL);
throw_warn(ls, "implicit global creation", "prefix this with 'global' to be explicit", WT_IMPLICIT_GLOBAL);
}
}
}
Expand Down

0 comments on commit d07edbe

Please sign in to comment.