[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Compiler warning/error for duplicate variable declaration
- From: Domingo Alvarez Duarte <mingodad@...>
- Date: Thu, 27 Dec 2018 11:24:15 +0100
Hello !
Doing several conversions from Lua to LJS
https://github.com/mingodad/ljs I found a frequent usage of duplicate
variable declarations that make the code hard to understand/port and in
some cases it causes bugs that pass unnoticed like this one in luajit
https://www.freelists.org/post/luajit/Duplicated-variable-declaration-BUG .
In LJS I created a compiler warning/error that catch those problems at
compile time see patches that can be applied to Lua in
http://lua-users.org/wiki/LuaPowerPatches .
I hope more people would be aware of this problem and that it could be
eliminated by using a compiler help like the one proposed.
If you have any code in Lua that you care I invite you to compile a
patched version of lua and try run your code with it to see if you have
this problem in your code.
Any comment/suggestion is welcome !
Cheers !