Docs menu

E148: A type was given the wrong number of type arguments

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

A generic struct declares its type parameters, and every use of it gives exactly one type for each: struct Box<T> takes one, struct Pair<A, B> takes two. A struct with no type parameters, or an enum, takes none.

Example
struct Point { x: int, y: int }struct Box<T> { v: T }mut p: Point<int> = Point::default();     // Point is not genericmut b: Box<int, int> = Box::default();    // Box takes one type

Write each type the way it was declared:

Example
mut p: Point = Point::default();mut b: Box<int> = Box::default();

Giving a generic struct no type arguments at all, mut b: Box = ..., is E138.

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

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

Esc

Type to search.