Diagnostics

Every message the taught compiler can refuse a program with, by family, with the cause and — where there is one — the fix. A diagnostic is written

file:line: teko: <cause>

and the compiler exits 1. A failure at run time is a panic with exit 70 and is memory.md § Panics instead.

The list below is checked against the sources by ../../scripts/check-docs.sh: a message that exists and is not documented here fails the docs gate. Some messages end mid-sentence in this page because the compiler appends a name to them — the quoted part is the fixed text, and the entry says what completes it.


Declarations and types #

Members and modifiers #

Constructors and destructors #

Inheritance, virtual and abstract #

Interfaces #

Traits #

Properties #

Operators #

Generics #

Delegates, lambdas and captures #

Arrays #

Namespaces, using and import #

Visibility #

Statements and control flow #

Parameters, overloads, ref/out and params #

Dependency injection #

Reference counting #

Expressions and the static-type oracle #

Capacity #

Every table the compiler keeps has a ceiling. Hitting one is a diagnostic, not a silent truncation; the fix is to split the unit.

messagelimit
"teko: too many type declarations"32 structs, classes and interfaces in one source
"teko: too many fields"256 fields, summed
"teko: too many methods"128 methods, summed
"teko: too many virtual slots"128 slots, summed
"teko: too many constructors"32, summed
"teko: too many default arguments"64, summed across all signatures
"teko: too many properties"64, summed
"teko: too many operators"64
"teko: too many interface methods"128, summed
"teko: too many implemented interfaces"64 (class, interface) pairs
"teko: too many interfaces in one class"8 in one : list
"teko: too many traits"32 declared in one source
"teko: too many traits in one `use`"32 queued at once
"teko: too many traits used by one class"32
"teko: traits nested too deep"a trait may use a trait 16 deep
"teko: too many generic declarations"16
"teko: too many generic parameters"4 per generic, 64 summed
"teko: too many generic instances"32
"teko: too many parts of a generic"32, summed
"teko: too many forward-declared types"32 read ahead of their use
"teko: too many `new` on a type declared below"32
"teko: too many static accesses on a type declared below"32
"teko: too many consts"128 member constants
"teko: too many top-level consts"128
"teko: too many local arrays"1024 declarations in scope
"teko: too many global arrays"512 in one source
"teko: too many global `T[]` of heap"32 in one source
"teko: too many array writes waiting to be resolved"512
"teko: too many array-field accesses"128
"teko: too many `T[]` parameters in one declaration"32
"teko: too many locals in one unit"8192
"teko: too many locals of struct type"256
"teko: too many expressions whose type is known"256
"teko: too many member accesses on a value of unknown type"128 waiting for the pass
"teko: too many stores into a slot of class type"128
"teko: too many declarations in one unit"8192
"teko: too many overloaded names in one unit"64
"teko: too many free-function declarations with parameters"4096
"teko: too many arguments"64 at one call of an overloaded name
"teko: too many parameters in one declaration"16, which the ABI's own 12 is under
"teko: too many `params` lists in one unit"64
"teko: too many `params` declarations in one unit"64
"teko: too many `ref`/`out` parameters in one unit"512
"teko: too many `ref`/`out` arguments in one unit"512
"teko: too many delegate targets"64 (delegate, function) pairs
"teko: too many captures in one lambda"32, summed across the lambdas being read
"teko: too many capturing lambdas"64 capturing by reference
"teko: too many tainted lambda locals"64
"teko: too many unresolved names in one lambda"64
"teko: too many namespaces"16 in one source
"teko: too many namespace segments"16
"teko: too many namespaced type names"64
"teko: too many namespaced free functions"256 in one namespace block
"teko: too many file-scoped namespaces"16
"teko: too many files declaring a namespace"32
"teko: too many using directives"32, across every file
"teko: too many case labels"128
"teko: too many switch expression arms"64
"teko: too many bare continues inside a switch"128
"teko: loops nested too deep"32 open at one point of one function
"teko: too many services"32 marked classes
"teko: too many `inject` sites"32
"teko: too many `scope` blocks"64, plus one per singleton
"teko: scopes nested too deep"32 open at once
"teko: too many nested service dependencies"32 under construction at once

What a v0.4.0 program cannot express at all, with the message it gets, is not-yet.md.

Edit this page