v0.13.8
errors and warnings / classes

errors and warnings / classes / E3047

E3047 error

overload function signature not followed by its implementation

area
classes (x3xxx)
fails the build
yes

An overload function signature isn't followed right away by its implementation: a function of the same name (function, local function or export function) must come directly after the signatures. Move the implementation up, or add it.

Example

× failswowlua
overload function size(s: string): numberlocal count = 0local function size(v: string): number    return #vendprint(size("a"), count)
✓ compileswowlua
local count = 0overload function size(s: string): numberlocal function size(v: string): number    return #vendprint(size("a"), count)

The compiler reports it like this:

error[E3047]: the overload signature of `size` is not followed by its implementation
  ┌─ src/main.wowlua:1:19
  │
1 │ overload function size(s: string): number
  │                   ^^^^ here
codemessage
E3044Overload implementation does not accept every overload signature

Offline

terminal
$ wowlua explain E3047
E3047 (error): overload function signature not followed by its implementation

source on GitHub ↗