v0.13.7
errors and warnings / stdlib

errors and warnings / stdlib / E8352

E8352 error

Invalid keybinding name (must match [A-Z][A-Z0-9_]*)

area
stdlib (x8xxx)
fails the build
yes

A keybinding name must match [A-Z][A-Z0-9_]*: capital letters, digits and underscores, starting with a letter. The game builds global names from it (BINDING_NAME_<name>). Prefix it with your addon's name to keep it unique, for example MYADDON_TOGGLE.

Example

× failswowlua
import binding from "wowlua:bindings" @binding("myaddon-toggle", { label = "Toggle window" })local function toggleWindow()    print("toggle")end
✓ compileswowlua
import binding from "wowlua:bindings" @binding("MYADDON_TOGGLE", { label = "Toggle window" })local function toggleWindow()    print("toggle")end

The compiler reports it like this:

error[E8352]: `myaddon-toggle` is no keybinding name: it matches `[A-Z][A-Z0-9_]*`
  ┌─ src/main.wowlua:3:10
  │
3 │ @binding("myaddon-toggle", { label = "Toggle window" })
  │          ^^^^^^^^^^^^^^^^ invalid
codemessage
E8351Duplicate keybinding name in the addon

Offline

terminal
$ wowlua explain E8352
E8352 (error): Invalid keybinding name (must match [A-Z][A-Z0-9_]*)

source on GitHub ↗