E3029

E3029 — A type name in a signature that names no declaration. An unknown name in type position parses as a user nominal, so without this a typo — or a type constructor removed from the language — compiled silently and did nothing.

What the compiler reports

E3029{{.*}}no type named 'Wibble' is declared or imported

The fragments the test suite holds the compiler to. An ellipsis marks text the test does not constrain; the emitted message also carries a source location.

A program that triggers it

//
// An unknown name in type position parses as a user-defined nominal type, and nothing downstream
// asked whether such a type was ever declared. So a typo in an annotation compiled, did nothing,
// and the only hint was a flat-path decline reading `a parameter type` -- which looks like an
// ordinary coverage gap rather than a mistake in the source.
//
// It is also how an obsolete type constructor keeps "working" in documentation long after it is
// removed: every example still compiles.

fn invented(t : Wibble<Frobnicate>) -> i32 {
  return 0;
}

fn bare(t : CompletelyMadeUp) -> i32 {
  return 0;
}

// A typo, which is the case that costs an afternoon: `Tesnor` is a nominal type named Tesnor.
fn misspelled(t : Tesnor) -> i32 {
  return 0;
}

// The return type is checked too, not only parameters.
fn in_return_position(x : i32) -> NoSuchResult {
  return 0;
}

fn main() -> i32 {
  return 0;
}

From tests/frontend/fail/undefined_type_name.vx, which asserts this diagnostic on every commit.

Related