U08

Warning

Declared and never read

U08 — A condition that is always the same

A literal condition, or a value compared with itself, decides the same way every time; one branch never runs.

What the compiler said

warning[U08]: `false` is always false, so one branch never runs --> src/App.wf:3:8 | 3 | if false { Text("Coming soon") } | ^^^^^ = help: Use the value that decides, or remove the branch that cannot run = docs: https://webfluent.monzeromer.dev/errors/U08

The fix

Broken

wf

page P(path: "/", title: "T", description: "D") { Heading("Beta").h1 if false { Text("Coming soon") } }

Fixed

wf

page P(path: "/", title: "T", description: "D") { state beta = false Heading("Beta").h1 if beta { Text("Coming soon") } }

Use the value that decides, or remove the branch that cannot run.

Each example is a whole program: it is all of src/App.wf in a project with no other .wf file (trying an example).

lints may lower it:

"lints": { "U08": "off" } // wf-allow(U08)