local s = sample.new()
s.key = 2
s.__index = 2
s.key2 = 2
Here should be 3 calls of __newindex, but It will prints only 2 calls:
newIndex called with key 'key'
newIndex called with key 'key2'
So, the problem is that sol is considering existence of metamethod __index as existence of table key with name __index.
This behaviour differ from solV2 and I'm trying to figure out is it feature or bug?)
Hello, I'm trying to migrate my project from solV2 to solV3 and found some problem with usage of metamethods
__index/__newindex
.Here is simple usertype with defined both
__index
and__newindex
and after that I'm trying yo use it in lua:
Here should be 3 calls of
__newindex
, but It will prints only 2 calls:So, the problem is that sol is considering existence of metamethod
__index
as existence of table key with name__index
. This behaviour differ from solV2 and I'm trying to figure out is it feature or bug?)Many thanks.