-
-
Notifications
You must be signed in to change notification settings - Fork 34
Closed
Labels
bugSomething isn't workingSomething isn't working
Description
remove_unused_variable
incorrectly removes unassigned local variables in grouped local assignments after a function call and assigned variable.
Reproduction
a.luau
:
local c = 0;
(function()
local a, b, c = (function()end)(), 0;
c = 1;
end)();
assert(c == 0);
.darklua.json
:
{
"rules": [
"remove_unused_variable"
]
}
darklua process a.luau out.luau --verbose
INFO > using configuration file `.darklua.json`
INFO > successfully processed `a.luau`
INFO > executed work in 1.2508ms
successfully processed 1 file (in 2.049ms)
darklua --version
darklua 0.13.1
out.luau
:
local c = 0;
(function()
local a=(function()end)();
c = 1;
end)();
assert(c == 0);
This output is incorrect. When combined with group_local_assignment
and rename_variables
, this bug is more likely to break scripts.
jeparlefrancais, inklesspen1rus and ceat-ceat
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working