v0.13.7
errors and warnings / stdlib

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.hook and @onTooltip for "Item", "Spell" and "Unit" on clients without the tooltip data system (the classic flavors) hook only GameTooltip, ItemRefTooltip and the shopping tooltips (and those given to tooltip.attach); the data has no raw, no guid for items and spells and no link for spells and units.
  • launcher.register on clients without the Addon Compartment adds no compartment entry; the minimap button and the LDB launcher work.
  • frames.movable with editMode on 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

× failswowlua.jsonjson
{    "package": { "name": "playground", "version": "0.1.0", "wowlua": "^0.13" },    "flavors": { "camelot": {}, "vanilla": {} }}
src/main.wowluawowlua
import * as launcher from "wowlua:launcher" launcher.register({ icon = "Interface\\Icons\\INV_Misc_Book_09", label = "Playground", onClick = function() end })
✓ compileswowlua.jsonjson
{    "package": { "name": "playground", "version": "0.1.0", "wowlua": "^0.13" },    "flavors": { "camelot": {}, "vanilla": {} }}
src/main.wowluawowlua
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
codemessage
E8300Standard-library function unavailable on a targeted flavor (no fallback)

Offline

terminal
$ wowlua explain W8301
W8301 (warning): Standard-library function uses a reduced fallback on a targeted flavor (lists missing fields or features)

source on GitHub ↗