You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
... seems to be a special name in two ways that aren't mentioned by the Overview: it's not otherwise a valid identifier, and a : varargs parameter not given that name is treated as : integer.
Code example
Type error in Nelua:
localfunctionf(items: varargs)
print(#items) -- error: in unary operation `len`: invalid operation for type 'int64'endf(1, 2, 3)
Codegen error:
localfunctionf(items: varargs) -- void va1_f_1(int64_t items)endf(1, 2, 3) -- error: too many arguments to function ‘va1_f_1’
Workaround
There's no problem if you write code that uses ...: varargs like in the Overview.
More ... development also seems to be waiting on the any type, based on tests like
it("any type", function()
...expect.run_error_c([[ local function f(...) return ... end]], "not supported yet")
Bug description
...
seems to be a special name in two ways that aren't mentioned by the Overview: it's not otherwise a valid identifier, and a: varargs
parameter not given that name is treated as: integer
.Code example
Type error in Nelua:
Codegen error:
Workaround
There's no problem if you write code that uses
...: varargs
like in the Overview.More
...
development also seems to be waiting on theany
type, based on tests likeEnvironment
x86_64 linux
Nelua 0.2.0-dev
Build number: 1610
Git date: 2023-11-19 16:54:45 -0300
Git hash: e82695a
Semantic version: 0.2.0-dev.1610+e82695ab
Copyright (C) 2019-2023 Eduardo Bart (https://nelua.io/)
The text was updated successfully, but these errors were encountered: