v0.13.7
errors and warnings / types

errors and warnings / types / E2012

E2012 error

No overload matches the call

area
types (x2xxx)
fails the build
yes
in plain Lua files
reported as W2012

The function has overloads, and none of them takes these arguments. The message lists every overload; compare your arguments with them. Many WoW API functions are declared with overloads, one per way Blizzard documents to call them.

Example

× failswowlua
overload function size(s: string): numberoverload function size(t: table): numberlocal function size(v: string | table): number    return #vendprint(size(5))
✓ compileswowlua
overload function size(s: string): numberoverload function size(t: table): numberlocal function size(v: string | table): number    return #vendprint(size("abc"))

The compiler reports it like this:

error[E2012]: no overload matches the arguments (5); overloads:
  (s: string) -> number
  (t: table) -> number
  ┌─ src/main.wowlua:6:7
  │
6 │ print(size(5))
  │       ^^^^^^^ here
codemessage
E2001Type mismatch: S is not assignable to T
E2006Too many arguments
E2007Missing argument

Offline

terminal
$ wowlua explain E2012
E2012 (error): No overload matches the call

source on GitHub ↗