Files
sx/examples/0213-generics-namespaced-call-result.sx
agra 515ecebea7 fix(0127): namespaced generic calls type their result from the call's bindings
The plan producer's namespace-fn arms returned the declared return type
without checking type_params, so a qualified generic call's result
carried the unbound T stub: print boxed it as 'T{}', and a non-s64
binding failed LLVM verification (pack monomorphized for the stub,
call returning double). Both fn_ast_map-backed arms now classify
generic callees as generic_fn and infer the return through
inferGenericReturnType, mirroring the bare-identifier path.
2026-06-12 08:53:25 +03:00

14 lines
544 B
Plaintext

// A NAMESPACED call to a generic free function types its result from the
// call's inferred bindings — not the unbound `T` stub (issue 0127:
// `m.pick(3, 9)` boxed as `T{}` while the flat spelling printed `9`).
#import "modules/std.sx";
m :: #import "0213-generics-namespaced-call-result/m.sx";
main :: () {
print("{}\n", m.pick(3, 9)); // s64 binding
print("{}\n", m.pick(1.5, 0.25)); // f64 binding
v := m.double(21);
w : s64 = v + 0; // the concrete type flows onward
print("{}\n", w);
}