[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Why duplicate keys in table constructor isn't an error?
- From: Ivko Stanilov <ivko@...>
- Date: Tue, 13 Mar 2007 16:12:42 +0200
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