lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


I've often made this mistake in my programs when copying/pasting table
elements, or just by oversight:

 local table = { key = "value1", ..., key = "value2" }

Shouldn't the compiler be able to detect this case and report a syntax
error? I know that you could possibly have expressions with side
effects in the place of "value1", but nevertheless I can't envision
a scenario in which having the same constants keys in the same table
constructor is intentional. This is a 100% error in the code and I
think it should be reported as such.

Regards,
Ivko