Kết xuấtvi

generic-call-type-args

Translation status: Tiếng Việt reader-locale proof. Code fences render through the vi pipeline; prose is canonical Latin.

Explicit type arguments at function and namespaced call sites.

Syntax: callee<type, ...>(args) — id<textus>(...), module.f<T>(...), tensor.creata<T>(...)

Category#

function

Examples#

radix/corpus/functio/generic-call-type-args.fab (canonical · concept)#

Explicit type arguments at function and namespaced call sites.

# =============================================================================
# generic-call-type-args — Explicit type arguments at function and namespaced call sites
# =============================================================================
#
# What this teaches:
#   • Explicit type arguments at function and namespaced call sites.
#   • Related keywords: functio, tensor, typi-parametri
#
# Common mistakes:
#   • Type parameter not satisfying the function's bounds — explicit type arguments must meet any constraints declared on the generic function.
#
# See also: functio, tensor, typi-parametri
# =============================================================================

# functio/generic-call-type-args — explicit call-site type arguments
#
# EXPECTED OUTPUT:
#   creata
#
# Application lane (`faber check` / `faber build` / Rust emit). Default
# `faber run` / script stepper do not yet lower explicit call-site type args.

fn identitas<T>(T x)  T {
    return x
}

main {
    print identitas<string>("creata")
}

Expected output:

creata