Renderingen-US

errors

Translation status: English reader-locale proof. Term names and code fences follow the en pack; supporting prose may still be English.

Marks a function parameter or binding as carrying an error value.

Syntax: fn <name>(...) errors <ident> → <type>

Category#

function

Examples#

radix/corpus/errata/errata.fab (canonical · keyword)#

Marks a function parameter or binding as carrying an error value.

# =============================================================================
# errors — Marks a function parameter or binding as carrying an error value.
# =============================================================================
#
# What this teaches:
#   • Error channel parameter — `errors <type>` marks a function as having a typed error channel, enabling structured error handling.
#   • Declaration-only — currently a declaration-only modifier; the error channel is whitelisted for syntax validation and future codegen.
#
# Common mistakes:
#   • Confusing errors with a ⊥ default — `errors` declares a typed error parameter on a function; `⊥` provides an inline default on conversion.
#
# See also: ⇥, catch, throw
# =============================================================================

# errors — typed error channel parameter
#
# GRAMMAR:
#   funcModifier :← 'errors' type
#
# EXPECTED OUTPUT:
#   No main — declaration or test-runner surface only.
#
# BACKEND:
#   declaration-only error channel (whitelist: errors/errata.fab).
#

fn parse(string raw) errors string → int {
    return 0
}