Open Ayplow opened 5 years ago
Attempting to use multiple assignment on a table with a __newindex metamethod, only the first value will be forwarded to it.
__newindex
To Reproduce
In moonsharp, the following script
local MT = {} function MT:__newindex(key, value) print(key, " was assigned to [", value, "]") end local T = {} setmetatable(T, MT) T.A, T.B = 1, 2
produces this output
A was assigned to [1] B was assigned to [nil]
Expected behavior The official Lua interpreter outputs
B was assigned to [ 2 ] A was assigned to [ 1 ]
Fix in #325
Attempting to use multiple assignment on a table with a
__newindex
metamethod, only the first value will be forwarded to it.To Reproduce
In moonsharp, the following script
produces this output
Expected behavior The official Lua interpreter outputs