渲染zh-Hans

勘误

Translation status: 简体中文 reader-locale proof. Term names and code fences follow the zh-Hans 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
}