Kết xuấtvi

generic-call-type-args

Translation status: Tiếng Việt reader-locale proof. Term names and code fences follow the vi pack; supporting prose may still be English.

Explicit type arguments at function and namespaced call sites.

Syntax: callee<type, ...>(args) — id<văn_bản>(...), 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: hàm, ten_xo, 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: hàm, ten_xo, typi-parametri
# =============================================================================

# hàm/generic-call-type-args — explicit call-site type arguments
#
# EXPECTED OUTPUT:
#   creata
#
# Application làn (`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