渲染zh-Hant

錯誤

Translation status: 繁體中文 reader-locale proof. Term names and code fences follow the zh-Hant pack; supporting prose may still be English.

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

Syntax: 函式 <name>(...) 錯誤 <ident> → <type>

Category#

function

Examples#

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

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

# =============================================================================
# 錯誤 — Marks a function parameter or binding as carrying an error value.
# =============================================================================
#
# What this teaches:
#   • Error channel parameter — `錯誤 <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 錯誤 with a ⊥ default — `錯誤` declares a typed error parameter on a function; `⊥` provides an inline default on 變換.
#
# See also: ⇥, 捕捉, 拋出
# =============================================================================

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

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