errors and warnings / types / E2002
E2002 error
Unknown type name
- area
- types (x2xxx)
- fails the build
- yes
- in plain Lua files
- reported as W2002
A type annotation names a type that doesn't exist: a typo, a type declared in
another module that isn't imported, or a type only some flavors have. Check
the spelling, or bring the type in with import type Name from "./module".
Example
local f: Fram = CreateFrame("Frame")print(f)local f: Frame = CreateFrame("Frame")print(f)The compiler reports it like this:
error[E2002]: unknown type `Fram` ┌─ src/main.wowlua:1:10 │ 1 │ local f: Fram = CreateFrame("Frame") │ ^^^^ not declared
Related codes
| code | message |
|---|---|
| E2013 | Wrong number of type arguments |
Offline
$ wowlua explain E2002 E2002 (error): Unknown type name