T16

Error

Types

T16 — A method a number, a string or a list does not have

In the browser the call is x.method is not a function, the first time the line runs. The message suggests the nearest method there is.

What the compiler said

error[T16]: a `[String]` has no method `joined` --> src/App.wf:4:16 | 4 | Text(names.joined(", ")) | ^^^^^^ = help: Did you mean `join`? = docs: https://webfluent.monzeromer.dev/errors/T16

Your editor offers this fix: Change to join. wf fix --code T16 applies it to every place it fits.

The fix

Broken

wf

page P(path: "/", title: "T", description: "D") { state names = ["Ada", "Grace"] Heading("People").h1 Text(names.joined(", ")) }

Fixed

wf

page P(path: "/", title: "T", description: "D") { state names = ["Ada", "Grace"] Heading("People").h1 Text(names.join(", ")) }

The method the message suggests — here join.

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.