errors and warnings / types / W2063
W2063 warning
A parameter without an annotation that nothing gives a type (no expected function type, or one that says any), or a local without an annotation whose value is any, or a generic type written without its type arguments (Box for Box<T>: they are any; decision T276), or a member a widget class doesn't declare, read or set through the openness of the game's frames (decision L51): it is any without saying so. Off unless check.lints sets it ("W2063": "warn"); names starting with _ are exempt (decision T274)
- area
- types (x2xxx)
- fails the build
- with --deny-warnings
A value is any without anyone writing any: a parameter nothing gives a
type, a local whose value is any, a generic type written without its type
arguments, or a member a frame or widget class doesn't declare. any turns
checking off, so mistakes there pass unseen. Annotate the value, or write
: any where you mean it.
The lint is off unless the manifest turns it on
("check": { "lints": { "W2063": "warn" } }). Names starting with _ are
exempt.
Example
{ "package": { "name": "playground", "version": "0.1.0", "wowlua": "^0.13" }, "flavors": { "camelot": {} }, "check": { "lints": { "W2063": "warn" } }}local function show(value) print(value)endshow(1){ "package": { "name": "playground", "version": "0.1.0", "wowlua": "^0.13" }, "flavors": { "camelot": {} }, "check": { "lints": { "W2063": "warn" } }}local function show(value: number) print(value)endshow(1)The compiler reports it like this:
warning[W2063]: parameter `value` is `any`: nothing gives it a type (annotate it) ┌─ src/main.wowlua:1:21 │ 1 │ local function show(value) │ ^^^^^ here
Related codes
| code | message |
|---|---|
| E2050 | Missing parameter type annotation (strict mode) |
Offline
$ wowlua explain W2063 W2063 (warning): A parameter without an annotation that nothing gives a type (no expected function type, or one that says any), or a local without an annotation whose value is any, or a generic type written without its type arguments (Box for Box<T>: they are any; decision T276), or a member a widget class doesn't declare, read or set through the openness of the game's frames (decision L51): it is any without saying so. Off unless check.lints sets it ("W2063": "warn"); names starting with _ are exempt (decision T274)