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
local playerName = UnitName("player")print(playerNmae)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
Related codes
Offline
$ wowlua explain W1001 W1001 (warning): Undefined global read (basic mode)