v0.13.7
errors and warnings / names

errors and warnings / names / W1033

W1033 warning

Load order cannot be determined (dynamic names, several writers, external names); files keep their source order

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

wowlua can't tell in which order some files must load, so they keep their source order (their place in build.load-order, then their path). The warning names the globals or fields that cause it: several files define the same name while loading, a name is written through a dynamic key (_G["x" .. i], ns[key]), or names come from outside the package. Give the name a single defining file, or fix the order with an import (import _ from "./file") or build.load-order.

Example

× failssrc/a.lualua
MyAddonDB = {}
src/b.lualua
MyAddonDB = { version = 2 }
src/c.lualua
print(MyAddonDB.version)
✓ compilessrc/a.lualua
MyAddonDB = {}
src/b.lualua
MyAddonDB.version = 2
src/c.lualua
print(MyAddonDB.version)

The compiler reports it like this:

warning[W1033]: the load order of the files defining `MyAddonDB` cannot be determined; they keep their source order
  ┌─ src/a.lua:1:1
  │
1 │ MyAddonDB = {}
  │ ^^^^^^^^^ defined here at load time
  │
  ┌─ src/b.lua:1:1
  │
1 │ MyAddonDB = { version = 2 }
  │ --------- defined here at load time
  │
  = help: import the module that should load first, or list the files in `build.load-order`
codemessage
W1034Name read at load time but only defined at run time
W1035Usage-analysis dependency contradicts build.load-order; the listed order is kept (contradicting imports are E1035)

Offline

terminal
$ wowlua explain W1033
W1033 (warning): Load order cannot be determined (dynamic names, several writers, external names); files keep their source order

source on GitHub ↗