errors and warnings / debugging / W7010
W7010 warning
Reflection metadata requested but reflection = "none"
- area
- debugging (x7xxx)
- fails the build
- with --deny-warnings
Code asks wowlua:reflect for full metadata (reflect.fields,
reflect.methods, reflect.functionInfo, …), but the profile sets
reflection = "none", so no metadata is emitted and the call finds none at
run time. The default, "decorated", keeps it for classes, enums and
functions marked @reflect; "all" keeps it for all of them. Class identity
(reflect.isInstance, reflect.className, the enum functions) is always
available and never warns.
Set the profile's reflection to "decorated" or "all", or remove the
reflection call.
Example
{ "package": { "name": "playground", "version": "0.1.0", "wowlua": "^0.13" }, "flavors": { "camelot": {} }, "profiles": { "dev": { "reflection": "none" } }}import * as reflect from "wowlua:reflect" @reflectclass Settings scale: number = 1end print(#reflect.fields(Settings)){ "package": { "name": "playground", "version": "0.1.0", "wowlua": "^0.13" }, "flavors": { "camelot": {} }, "profiles": { "dev": { "reflection": "decorated" } }}import * as reflect from "wowlua:reflect" @reflectclass Settings scale: number = 1end print(#reflect.fields(Settings))The compiler reports it like this:
warning[W7010]: reflection metadata is requested, but this profile has `reflection = "none"` ┌─ src/main.wowlua:8:8 │ 8 │ print(#reflect.fields(Settings)) │ ^^^^^^^^^^^^^^^^^^^^^^^^ returns nil
Offline
$ wowlua explain W7010 W7010 (warning): Reflection metadata requested but reflection = "none"