errors and warnings / stdlib / W8301
W8301 warning
Standard-library function uses a reduced fallback on a targeted flavor (lists missing fields or features)
- area
- stdlib (x8xxx)
- fails the build
- with --deny-warnings
A standard-library function falls back to a reduced version on one of the flavors you build for, because that client lacks an API it uses. It still works there, with less, and the warning lists what is missing:
tooltip.hookand@onTooltipfor"Item","Spell"and"Unit"on clients without the tooltip data system (the classic flavors) hook onlyGameTooltip,ItemRefTooltipand the shopping tooltips (and those given totooltip.attach); the data has noraw, noguidfor items and spells and nolinkfor spells and units.launcher.registeron clients without the Addon Compartment adds no compartment entry; the minimap button and the LDB launcher work.frames.movablewitheditModeon clients without Edit Mode ignores the option: the frame is an ordinary movable frame. Every flavor's client has Edit Mode now.
Keep the call to the flavors that have the full version (an if flavor == …
branch or @if), turn the feature off where it has an option
(compartment = false), or accept the warning. A function a flavor can't
offer at all is E8300.
Example
{ "package": { "name": "playground", "version": "0.1.0", "wowlua": "^0.13" }, "flavors": { "camelot": {}, "vanilla": {} }}import * as launcher from "wowlua:launcher" launcher.register({ icon = "Interface\\Icons\\INV_Misc_Book_09", label = "Playground", onClick = function() end }){ "package": { "name": "playground", "version": "0.1.0", "wowlua": "^0.13" }, "flavors": { "camelot": {}, "vanilla": {} }}import * as launcher from "wowlua:launcher"import flavor from "wowlua:meta" launcher.register({ icon = "Interface\\Icons\\INV_Misc_Book_09", label = "Playground", onClick = function() end, compartment = flavor == "camelot",})The compiler reports it like this:
warning[W8301]: `launcher.register` uses a reduced fallback on vanilla, without `AddonCompartmentFrame`: no Addon Compartment entry (the minimap button and the LDB launcher work) ┌─ src/main.wowlua:3:1 │ 3 │ launcher.register({ icon = "Interface\\Icons\\INV_Misc_Book_09", label = "Playground", onClick = function() end }) │ ^^^^^^^^^^^^^^^^^ reduced on some targeted flavors │ = help: pass `compartment = false` where you don't want the entry
Related codes
| code | message |
|---|---|
| E8300 | Standard-library function unavailable on a targeted flavor (no fallback) |
Offline
$ wowlua explain W8301 W8301 (warning): Standard-library function uses a reduced fallback on a targeted flavor (lists missing fields or features)