[Lua] Function mis-scope
What happened?
Special case function definition gets scoped to string:
local x = {
func1 = not false and function(...) end or nil, -- func1 is `string.unquoted.key.lua`
func2 = function(...) end, -- func2 is `entity.name.function.lua`
}
Both function (func1 and func2) definition should be entity.name.function.lua
Trying to determine whether func1 in func1 = not false and function(...) end or nil is a function is too generic of a problem to be solved on a syntax definition level, because you'd need to properly parse the expression and evaluate all possibilities whether one of them could end up with a function object.
Yeah honestly I don't have a proper solution for this, that's why i created the ticket, but it just could be not solvable.
Not an lua expert, but as func1 is scoped as dictionary key, I wonder why func2 is not.