T02
Error
Types
T02 — A case the enum does not have
.loud given where an enum is wanted that has no case loud.
What the compiler said
error[T02]: `Tone` has no case `.quiet` --> src/App.wf:3:17 | 3 | state tone: Tone = .quiet | ^^^^ = help: `Tone` takes .calm, .loud = docs: https://webfluent.monzeromer.dev/errors/T02
The fix
Broken
enum Tone { calm, loud }
page P(path: "/", title: "T", description: "D") {
state tone: Tone = .quiet
Heading("Tone").h1
}
Fixed
enum Tone { calm, loud }
page P(path: "/", title: "T", description: "D") {
state tone: Tone = .calm
Heading("Tone: {tone}").h1
}
Use one of the cases the message lists, or add the case to the enum.
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 cannot lower it: it would ship a broken page.