Drop global variable shadowing warning on universal var unset

When unsetting, the scope indicates the scope that was *removed* not
set, so the warning is incorrectly triggered. If anything, the confusion
is now removed or we emit a warning that the variable is still present
in another scope (but don't do that!).

Closes #9338.
This commit is contained in:
Mahmoud Al-Qudsi 2022-11-10 21:23:20 -06:00
parent e551f93f6d
commit 093ee6def5

View file

@ -664,8 +664,6 @@ static int builtin_set_erase(const wchar_t *cmd, set_cmd_opts_t &opts, int argc,
// This is cheesy, but I don't expect this to be checked often. // This is cheesy, but I don't expect this to be checked often.
if (retval != STATUS_CMD_OK) { if (retval != STATUS_CMD_OK) {
ret = retval; ret = retval;
} else {
warn_if_uvar_shadows_global(cmd, opts, split->varname, streams, parser);
} }
} }
} }