v0.13.7
errors and warnings / types

errors and warnings / types / W2055

W2055 warning

Too many arguments to an unannotated function (basic mode). Replaces the second meaning of W2006.

area
types (x2xxx)
fails the build
with --deny-warnings

Basic mode: a call passes more arguments than a function without any annotations takes. Lua drops the extra ones. It is a warning because plain Lua code often does this on purpose; in strict mode it is E2006. Remove the extra arguments or add the parameters.

Example

× failswowlua
local function add(a, b)    return a + bendprint(add(1, 2, 3))
✓ compileswowlua
local function add(a, b)    return a + bendprint(add(1, 2))

The compiler reports it like this:

warning[W2055]: too many arguments: expected 2, got 3
  ┌─ src/main.wowlua:4:17
  │
4 │ print(add(1, 2, 3))
  │                 ^ here
codemessage
E2006Too many arguments

Offline

terminal
$ wowlua explain W2055
W2055 (warning): Too many arguments to an unannotated function (basic mode). Replaces the second meaning of W2006.

source on GitHub ↗