Error codes › program-type

Error codes

program-type

error Programs: modules, their types and functions, written as TypeScript (the `program` extension, ADR 010)

What it means#

A program's type — map<K, V>, a function type fn(n: int32) -> bool, unknown — or a generic union or function (union Either<L, R>, fn first<T>), an async fn or a TypeScript value (const X = ```ts …````), written outside a module. They are types of the programextension (ADR 010), which a module's TypeScript has: write them in amodule, or use the types every model has (T[]`, a struct) elsewhere.

How to fix it#

The message says what is wrong and where, and often what was meant (Did you mean …?). Change the model so that what this page describes no longer holds, then check again: archec check main.arche.

An error: archec builds nothing until it is fixed.

archec check --beginner says the most common messages in plain words, with the names that exist.

The automatic fix#

archec has no fix of its own for this code. When the message says Did you mean …?, VS Code offers that change (Quick Fix).

In the terminal#

archec explain program-type prints this explanation; archec explain program lists the codes of its area.