Vitte Errors
This page is the stable reference for common diagnostics and fixes.
Layer map:
parse: syntax and structure checks.resolve: name, type, import and declaration checks.IR: lowering and intermediate representation checks.backend: Code generation and toolchain checks.
Each diagnosis follows the same structure:
- Code
- Symptom
- Probable cause
- Correction
- Example
- See also
- Code:
E0001 - Layer:
parse - Symptom: The parser was expecting a variable, type, module, or declaration name.
- Probable cause: a declaration is missing its identifier, or the token after a keyword is not a valid name.
- Fix: Add a valid identifier where the parser indicates.
- Example:
proc main() -> i32 { return 0 }
- See also:
book/poche/07-reading-errors.html,book/cli.html
- Code:
E0002 - Layer:
parse - Symptom: The parser was expecting an expression at this location.
- Probable cause: A value, call, or block expression is missing after a keyword or operator.
- Fix: provide an expression like
1,name,call()or{ ... }. - Example:
let x = 1
- See also:
book/poche/07-reading-errors.html,book/cli.html
- Code:
E0003 - Layer:
parse - Symptom: The parser was expecting a pattern.
- Probable cause: A construct
whenor similar tomatchreceived an incomplete pattern. - Fix: use a pattern as an identifier or constructor, for example
Some(x). - Example:
when x is Option.Some { return 0 }
- See also:
book/poche/07-reading-errors.html,book/cli.html
- Code:
E0004 - Layer:
parse - Symptom: The parser was expecting a type name.
- Probable cause: A type annotation is present, but the right member is missing or malformed.
- Fix: Use a built-in type or a named type, for example
intorOption[T]. - Example:
proc id(x: int) -> int { return x }
- See also:
book/poche/07-reading-errors.html,book/cli.html
- Code:
E0005 - Layer:
parse - Symptom: A block was opened but not closed with
endor.end. - Probable cause: a
proc,formorpickblock is missing its terminator. - Fix: Add missing terminator for open construct.
- Example:
form Point
field x as int
.end
- See also:
book/poche/07-reading-errors.html,book/cli.html
- Code:
E0006 - Layer:
parse - Symptom: An attribute must be followed by an
procdeclaration. - Probable cause: the attribute is hooked to the wrong element or is alone.
- Fix: Place the attribute directly above a
proc. - Example:
#[inline]
proc add(a: int, b: int) -> int { return a + b }
- See also:
book/poche/07-reading-errors.html,book/cli.html
- Code:
E0007 - Layer:
parse - Symptom: The parser was expecting a top-level declaration.
- Probable cause: An element appears at the root of the file, but it is not one of the supported declarations.
- Correction: limit the top-level to
space,use,form,pick,type,const,procandentry. - Example:
space my/app
proc main() -> int { return 0 }
- See also:
book/poche/07-reading-errors.html,book/cli.html
- Code:
E0008 - Layer:
parse - Symptom: A pattern has linked the same name more than once.
- Probable cause: The pattern reuses a binding in two places.
- Fix: give a separate name to each binding.
- Example:
when Pair(x, x) { return 0 }
- See also:
book/poche/07-reading-errors.html,book/cli.html
- Code:
E0009 - Layer:
resolve - Symptom: A referenced type name was not found.
- Probable cause: Type is misspelled or not imported.
- Fix: check spelling or import type with
useorpull. - Example:
use std/core/option.Option
proc f(x: Option[int]) -> int { return 0 }
- See also:
book/compiler-stdlib-contract.html,book/cli.html
- Code:
E0010 - Layer:
resolve - Symptom: The base type of a generic was not found.
- Probable cause: Generic base type is misspelled or not imported.
- Fix: check spelling or import base type with
useorpull. - Example:
use std/core/option.Option
let x: Option[int] = Option.None
- See also:
book/compiler-stdlib-contract.html,book/cli.html
- Code:
E0011 - Layer:
resolve - Symptom: A generic type was written without a type argument.
- Probable cause: Type application is incomplete.
- Fix: provide one or more type arguments between
[ ]. - Example:
let x: Option = Option.None
- See also:
book/compiler-stdlib-contract.html,book/cli.html
- Code:
E0012 - Layer:
resolve - Symptom: This type form is not yet supported.
- Probable cause: The type syntax is valid enough to be parsed, but the compiler does not yet accept this form.
- Fix: Use a supported type form like built-in types, named types, pointers, slices or proc types.
- Example:
let p: *int = &value
- See also:
book/compiler-stdlib-contract.html,book/cli.html
- Code:
E0013 - Layer:
resolve - Symptom: A referenced name was not found in the current scope.
- Probable cause: The symbol is misspelled, out of scope, or not imported.
- Correction: check the spelling or import it from a module with
useorpull. - Example:
use std/bridge/print
proc main() -> int { print("hi"); return 0 }
- See also:
book/compiler-stdlib-contract.html,book/cli.html
- Code:
E0014 - Layer:
parse - Symptom: A summon has no callee.
- Probable cause: The calling expression starts with arguments instead of a function or proc name.
- Fix: provide a function or proc name before arguments.
- Example:
print("hi")
- See also:
book/poche/07-reading-errors.html,book/cli.html
- Code:
E0015 - Layer:
IR - Symptom: This expression is not yet supported by HIR lowering.
- Probable cause: The expression form achieves lowering, but the lowering path does not implement it yet.
- Fix: Rewrite expression with supported constructors.
- Example:
let x = value
- See also:
book/cli.html,book/technical-index.html
- Code:
E0016 - Layer:
IR - Symptom: This pattern is not yet supported by HIR lowering.
- Probable cause: The pattern reaches lowering, but the lowering path does not implement it yet.
- Fix: Rewrite pattern with supported constructors.
- Example:
when x is Option.Some { return 0 }
- See also:
book/cli.html,book/technical-index.html
- Code:
E0017 - Layer:
IR - Symptom: This instruction is not yet supported by HIR lowering.
- Probable cause: The statement form achieves lowering, but the lowering path does not implement it yet.
- Fix: Rewrite the statement with supported constructors.
- Example:
return 0
- See also:
book/cli.html,book/technical-index.html
- Code:
E0018 - Layer:
resolve - Symptom: An extern procedure cannot define a body.
- Probable cause:
#[extern]and a body were combined on the same proc. - Fix: remove body or remove
#[extern]if you want to implement it here. - Example:
#[extern]
proc puts(s: string) -> int
- See also:
book/compiler-stdlib-contract.html,book/cli.html
- Code:
E0019 - Layer:
resolve - Symptom: A procedure must have a body unless it is marked
#[extern]. - Probable cause: the declaration ends without a body or the extern marker is missing.
- Fix: add body with
{ ... }or mark proc#[extern]. - Example:
proc add(a: int, b: int) -> int { return a + b }
- See also:
book/compiler-stdlib-contract.html,book/cli.html
- Code:
E0020 - Layer:
resolve - Symptom: A type alias must specify a target type.
- Probable cause: Alias ​​definition stops after name.
- Fix: provide right side of alias.
- Example:
type Size = int
- See also:
book/compiler-stdlib-contract.html,book/cli.html
- Code:
E0021 - Layer:
resolve - Symptom: A generic type needs at least one type argument.
- Probable cause: Generic application is empty.
- Fix: provide type arguments between
[ ]. - Example:
let xs: List = List.empty()
- See also:
book/compiler-stdlib-contract.html,book/cli.html
- Code:
E0022 - Layer:
IR - Symptom: The compiler encountered an unexpected HIR type shape.
- Probable cause: lowering reached a type shape that is not handled correctly.
- Fix: Try a simpler type and report the problem if it occurs again.
- Example:
let x: int = 0
- See also:
book/cli.html,book/technical-index.html
- Code:
E0023 - Layer:
IR - Symptom: The compiler encountered an unexpected HIR expression form.
- Probable cause: lowering has reached a form of expression that is not handled correctly.
- Fix: try a simpler expression and report the problem if it occurs again.
- Example:
let x = 1
- See also:
book/cli.html,book/technical-index.html
- Code:
E0024 - Layer:
resolve - Symptom: An
selectinstruction needs at least onewhenbranch. - Probable cause: block
selectwas opened but not populated with valid branches. - Correction: add a clause
whenand possiblyotherwise. - Example:
select x
when int(v) { return v }
otherwise { return 0 }
- See also:
book/poche/07-reading-errors.html,book/cli.html
- Code:
E0025 - Layer:
resolve - Symptom: Each
selectbranch must be anwheninstruction. - Probable cause: A branch is using a form of instruction that is not allowed at this location.
- Fix: replace branch with pattern
whenor useotherwise. - Example:
select x
when int(v) { return v }
otherwise { return 0 }
- See also:
book/poche/07-reading-errors.html,book/cli.html
- Code:
E0026 - Layer:
IR - Symptom: The compiler encountered an unexpected HIR instruction form.
- Probable cause: Lowering encountered an instruction form that should not reach this path.
- Fix: try a simpler instruction and report a compiler bug if it happens again.
- Example:
return 0
- See also:
book/cli.html,book/technical-index.html
- Code:
E0027 - Layer:
IR - Symptom: The compiler encountered an unexpected HIR pattern shape.
- Probable cause: Lowering encountered a pattern shape that should not reach this path.
- Fix: try a simpler pattern and report a compiler bug if it happens again.
- Example:
when x is Option.None { return 0 }
- See also:
book/cli.html,book/technical-index.html
- Code:
E0028 - Layer:
IR - Symptom: The compiler encountered an unexpected form of HIR declaration.
- Probable cause: Lowering encountered a declaration form that should not reach this path.
- Fix: try a simpler declaration and report a compiler bug if it happens again.
- Example:
proc main() -> int { return 0 }
- See also:
book/cli.html,book/technical-index.html