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
overload function size(s: string): numberoverload function size(t: table): numberlocal function size(v: string | table): number return #vendprint(size(5))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
Related codes
Offline
$ wowlua explain E2012 E2012 (error): No overload matches the call