First implementation of constant propagation
Local constant variables initialized with compile-time constants are optimized away from the code.
This commit is contained in:
@@ -324,7 +324,7 @@ do
|
||||
|
||||
-- errors due to non-closable values
|
||||
local function foo ()
|
||||
local <toclose> x = 34
|
||||
local <toclose> x = {}
|
||||
end
|
||||
local stat, msg = pcall(foo)
|
||||
assert(not stat and string.find(msg, "variable 'x'"))
|
||||
|
||||
Reference in New Issue
Block a user