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
import binding from "wowlua:bindings" @binding("myaddon-toggle", { label = "Toggle window" })local function toggleWindow() print("toggle")endimport binding from "wowlua:bindings" @binding("MYADDON_TOGGLE", { label = "Toggle window" })local function toggleWindow() print("toggle")endThe 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
Related codes
| code | message |
|---|---|
| E8351 | Duplicate keybinding name in the addon |
Offline
$ wowlua explain E8352 E8352 (error): Invalid keybinding name (must match [A-Z][A-Z0-9_]*)