Why this fires¶
This is a warning, not a hard error — it does not fail the build. A function declares its own parameter named key, but is called with the MARKUP spelling of key=. Since key is a reserved markup attribute (spec V24), it is always routed through the extras map — it is never bound to the function's own key parameter. The value the caller wrote is silently discarded from the function's point of view: it only ever reaches the client-side morph's data-zolo-key marker, while the declared parameter quietly falls back to its own default.
fn Cell(key: str = "?", val: int = 0) -> View {
<li>{key}={val}</li>
}
<Cell key="a" val={1}/>
// warning[TE727]: `key` is a reserved markup attribute and no longer
// reaches the `key` parameter of `Cell` — rename the parameter
//
// renders `<li data-zolo-key="a">?=1</li>`, NOT `<li>a=1</li>`The build succeeds and nothing else looks wrong — this is exactly the "green build, wrong output" class of bug the diagnostic exists to catch.
Fix it¶
Rename the parameter — Cell no longer has to compete with markup's own key:
fn Cell(item_key: str = "?", val: int = 0) -> View {
<li>{item_key}={val}</li>
}
<Cell item_key="a" val={1}/>
// renders `<li>a=1</li>`If what you actually want is the client-side diffing hint (not a data parameter), keep key= and stop also declaring a key parameter for it — li/tr are the model for this (see below).
The BUILDER spelling is unaffected¶
Cell(key: "a") passes key as an ordinary named argument on Cell's own call — it never touches the extras map, so it reaches the declared parameter exactly as written. This diagnostic never fires for the builder spelling.
Why li and tr never warn¶
li and tr (std::html) both declare a key parameter too, but forward it straight into the same data-zolo-key mechanism the markup extras path also writes to. The parameter and the attribute are two routes to the identical output for these two elements, so there is nothing shadowed and nothing to warn about — <li key={t.id}> and li(key: t.id) { ... } behave the same either way.