v0.13.7
errors and warnings / debugging

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

× failswowlua.jsonjson
{    "package": { "name": "playground", "version": "0.1.0", "wowlua": "^0.13" },    "flavors": { "camelot": {} },    "profiles": { "dev": { "reflection": "none" } }}
src/main.wowluawowlua
import * as reflect from "wowlua:reflect" @reflectclass Settings    scale: number = 1end print(#reflect.fields(Settings))
✓ compileswowlua.jsonjson
{    "package": { "name": "playground", "version": "0.1.0", "wowlua": "^0.13" },    "flavors": { "camelot": {} },    "profiles": { "dev": { "reflection": "decorated" } }}
src/main.wowluawowlua
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

terminal
$ wowlua explain W7010
W7010 (warning): Reflection metadata requested but reflection = "none"

source on GitHub ↗