Docs menu

E106: A colon is missing

What compiler error E106 means, and how to fix it.

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:

Example
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:

Example
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:

Example
otherwise: { ... }

Run turf --explain E106 in a terminal to read this again.

Last updated: Oct 15, 2026Edit this page on GitHub

Esc

Type to search.