渲染zh-Hant

永不

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

Primitive never type for code paths that do not return normally.

Aliases: never

Syntax: 永不

Category#

type

Examples#

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

Primitive never type for code paths that do not return normally.

# =============================================================================
# 永不 — Primitive never type for code paths that do not return normally.
# =============================================================================
#
# What this teaches:
#   • Diverging functions — `永不` marks functions like `崩潰` that never return to the caller.
#   • Type-system bottom — `永不` is the bottom type, compatible with any return position.
#
# Common mistakes:
#   • Using 永不 for functions that might sometimes return normally — 永不 is only for code paths that never return.
#
# See also: 崩潰, 出口
# =============================================================================

# 永不 — diverging return type
#
# GRAMMAR:
#   returnType :← '永不'
#
# EXPECTED OUTPUT:
#   Scalar stdout smoke (see body).
#
# BACKEND:
#   Cross-ref: 崩潰/mori.fab.
#

fn fail(string message) → never {
    panic message
}