pkulchenko / ZeroBraneStudio

Lightweight Lua-based IDE for Lua with code completion, syntax highlighting, live coding, remote debugger, and code analyzer; supports Lua 5.1, 5.2, 5.3, 5.4, LuaJIT and other Lua interpreters on Windows, macOS, and Linux
http://studio.zerobrane.com/
Other
2.6k stars 519 forks source link

Variable arguments not working as properly #1128

Closed Kindi-Equinox closed 2 years ago

Kindi-Equinox commented 2 years ago
local function func(...)
for k, v in pairs(arg) do
print(k, v)
end
end

func(1,2,3,4,5)

Doesn't work. It gives out negative indices and unrelated values.

pkulchenko commented 2 years ago

This is not a problem with the IDE. You should be using {...} instead of arg, as arg usage for vararg functions has been deprecated since Lua 5.1: https://www.lua.org/manual/5.1/manual.html#7.1.