v0.13.7
errors and warnings / names

errors and warnings / names / W1001

W1001 warning

Undefined global read (basic mode)

area
names (x1xxx)
fails the build
with --deny-warnings

The code reads a global that nothing declares (see E1001 for what counts as declared). It is a warning in basic mode, the default, and in plain Lua files; strict mode makes it the error E1001. Usually it is a typo or a missing local, and the value is nil in game. Fix the name, or declare a global that comes from somewhere the checker can't see: declare global, or the manifest's check.globals for another addon's globals.

Example

× failswowlua
local playerName = UnitName("player")print(playerNmae)
✓ compileswowlua
local playerName = UnitName("player")print(playerName)

The compiler reports it like this:

warning[W1001]: `playerNmae` is not a declared global
  ┌─ src/main.wowlua:2:7
  │
2 │ print(playerNmae)
  │       ^^^^^^^^^^ here
codemessage
E1001Undefined global read (strict mode)
W1002Implicit global assignment (basic mode)

Offline

terminal
$ wowlua explain W1001
W1001 (warning): Undefined global read (basic mode)

source on GitHub ↗