v0.13.7
errors and warnings / names

errors and warnings / names / E1003

E1003 error

Undefined local or upvalue in a wowlua construct (e.g. a decorator argument)

area
names (x1xxx)
fails the build
yes
in plain Lua files
reported as W1003

A name used in a wowlua construct, such as a decorator argument, is not a local or upvalue in scope there, nor a declared global. A decorator's arguments are evaluated where the declaration is, when the file loads, so the name must exist there. It is an error in every mode, where reading an undeclared global elsewhere is W1001 or E1001. Declare the local before the declaration, or fix the name.

Example

× failswowlua
import throttle from "wowlua:timer" @throttle(delay)local function refresh()endrefresh()
✓ compileswowlua
import throttle from "wowlua:timer" local delay = 0.5 @throttle(delay)local function refresh()endrefresh()

The compiler reports it like this:

error[E1003]: `delay` is not a local, an upvalue or a declared global here: decorator arguments are evaluated where the declaration is
  ┌─ src/main.wowlua:3:11
  │
3 │ @throttle(delay)
  │           ^^^^^ here
codemessage
E1001Undefined global read (strict mode)

Offline

terminal
$ wowlua explain E1003
E1003 (error): Undefined local or upvalue in a wowlua construct (e.g. a decorator argument)

source on GitHub ↗