tripon[github]

diagnostic codes / Driver

E0501 entry-point-missing

There is no `main` to start from.

E0501entry-point-missingdefine fn main() -> i32
severityerror
bandDriver
in the v0 bootstrapemitted
explainralt explain E0501

The driver looks for `fn main()` after a successful check. The diagnostic has no useful source position because there is no token to point at; it reports `(null):1:1` and carries the signature it wants.

What it looks like

e0501.tp
use tier core;

fn helper() -> i32 {
    return 1;
}
ralt check e0501.tp
(null):1:1: error: no fn main() found in this file
  [E0501 entry-point-missing] define fn main() -> i32

What to do

  • Add `fn main() -> i32 { return 0; }`.
  • `fn main()` with no return type also builds and exits 0; the `-> i32` form is the one the hint asks for because it can report a status.
  • An empty file is this error, not a parse error.

Why the code exists

A program needs an entry point. Reporting it as a named code keeps a harness from having to match English in the linker's output.

What ralt explain says

ralt explain E0501
E0501
severity: error
name: entry-point-missing
hint: define fn main() -> i32

Related