-
Notifications
You must be signed in to change notification settings - Fork 14
Open
Description
Lua 5.4 now supports const variables.
local foo <const> = 5
foo = 6 -- runtime errorThis sort of thing is very useful for declaring variables that you know shouldn't change. Unfortunately, luacheck doesn't yet include a warning if you do something like the above, so it won't get caught until runtime.
What's the consensus here about using this new construct, assuming that your script requires RGP Lua 0.67 or greater? I'd like to start using it, but I'm a little hesitant without a warning from luacheck if I do something wrong. (Although testing ought to exercise all the pathways and hit the error at runtime.)
Metadata
Metadata
Assignees
Labels
No labels