Summary
Explicit type arguments (turbofish) on a free generic function with value arguments are not accepted: f[T](args) reports error: value is not callable. Only intrinsics (sizeof[T](), transmute[T](v), chan[T](cap)) and generic methods (recv.m[T](args)) support explicit type args; no-arg generic calls (g[T]()) also work. Return-type-driven inference does not fill the gap either (let x: S = ret_only(buf) → error: unknown type 'T').
Repro
fn id[T](x: T) -> T: x
fn main:
let a = id[i32](42) // error: value is not callable
id(42) (inference) works; id[i32](42) does not.
Impact
Any free generic function whose T is not inferable from its value arguments (e.g. T appears only in the return type) is uncallable. This forced std.ffi (#436) to shape its recovery helpers as unbox_ctx[T](ctx: *mut T) (T carried by a cast argument) instead of the spec-natural unbox_ctx[State](ctx).
Root cause (where to look)
Sema.check_call (src/SemaCheck.w): a callee that is NK_INDEX over a plain NK_IDENT (the f[T] form) is only handled when the index base is a NK_FIELD_ACCESS (generic method / collect). For an ident base resolving to a generic free function, control falls through to the kind != NK_IDENT → "value is not callable" path (~line 11530). A branch that recognizes ident[TypeArgs](args) and binds the type args to the generic instantiation is missing.
Summary
Explicit type arguments (turbofish) on a free generic function with value arguments are not accepted:
f[T](args)reportserror: value is not callable. Only intrinsics (sizeof[T](),transmute[T](v),chan[T](cap)) and generic methods (recv.m[T](args)) support explicit type args; no-arg generic calls (g[T]()) also work. Return-type-driven inference does not fill the gap either (let x: S = ret_only(buf)→error: unknown type 'T').Repro
id(42)(inference) works;id[i32](42)does not.Impact
Any free generic function whose
Tis not inferable from its value arguments (e.g.Tappears only in the return type) is uncallable. This forcedstd.ffi(#436) to shape its recovery helpers asunbox_ctx[T](ctx: *mut T)(T carried by a cast argument) instead of the spec-naturalunbox_ctx[State](ctx).Root cause (where to look)
Sema.check_call(src/SemaCheck.w): a callee that isNK_INDEXover a plainNK_IDENT(thef[T]form) is only handled when the index base is aNK_FIELD_ACCESS(generic method /collect). For an ident base resolving to a generic free function, control falls through to thekind != NK_IDENT → "value is not callable"path (~line 11530). A branch that recognizesident[TypeArgs](args)and binds the type args to the generic instantiation is missing.