Discovered when I was rewriting typescript-to-lua code. If you have a function call as last statement in for loop then interpreter (neovim's) complains about ambiguous functon call.
// input.js
for (let i = 0; i < array; ++i) {
somefunc(array[i + 1]);
// let _nil; // this is a quick fix for this issue
}
-- output.lua
do
local i = 0
while i < #array do
somefunc(array[i + 1]) -- can also insert ; here to fix issue
-- local _nil -- generated from fix
(function() -- <- AMBIGUOUS FUNCTION CALL
i = i + 1
return i
end)()
end
end
Discovered when I was rewriting typescript-to-lua code. If you have a function call as last statement in for loop then interpreter (neovim's) complains about ambiguous functon call.