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
A tour of VxThe chapter covering the rule this code enforces.
All diagnosticsEvery code the compiler can emit, grouped by stage.
E3028A function with a non-void return type whose body can complete without returning. Reported here rather than left to codegen, where it surfaced as an MLIR verifier message naming an operation, with no source location.
E3030An operator applied to operand types it is not defined on —
% on a shaped tensor or on a bool. Refused here because the alternative is worse in both directions: the flat emitter would decline and fall back to a path that cannot lower it either, and an i1 operand would reach arith.remsi and verify.