In Turf a colon : joins a name to its type, and a function’s parameter list to its return type. Turf expected one and found something else.
The commonest case is forgetting the colon before a function’s return type:
fn add(a: int, b: int) int { // needs `:` before `int` return a + b;}fn add(a: int, b: int): int { return a + b;}A function that declares no return type at all reports the same error: every function says what it returns, : void when it returns nothing. The compiler tries void, the basic types and the types of the function’s parameters, and when exactly one of them compiles with the body and the function’s callers, it prints that as a Fix:.
The same shape shows up for a parameter or a struct field, which is name: type:
fn greet(name string) { } // should be `name: string`struct User { age int } // should be `age: int`And in compare, the matches and otherwise arms need a colon before their body:
otherwise: { ... }Run turf --explain E106 in a terminal to read this again.