T10

Error

Types

T10 — A call with the wrong arguments

Too many or too few arguments, a name the callee does not take, or one of the wrong kind.

What the compiler said

error[T10]: `add` takes 1 argument, but 2 are given --> src/App.wf:5:30 | 5 | Button("+") { on click { add(1, 2) } } | ^^^ = docs: https://webfluent.monzeromer.dev/errors/T10

The fix

Broken

wf

page P(path: "/", title: "T", description: "D") { state count = 0 action add(step: Number) { count = count + step } Heading("Count").h1 Button("+") { on click { add(1, 2) } } }

Fixed

wf

page P(path: "/", title: "T", description: "D") { state count = 0 action add(step: Number) { count = count + step } Heading("Count").h1 Button("+") { on click { add(1) } } }

Pass the arguments the action, endpoint or function takes.

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.