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.
10 lines
123 B
Plaintext
10 lines
123 B
Plaintext
#import "modules/std.sx";
|
|
|
|
pick :: (a: $T, b: T) -> T {
|
|
if a > b then a else b
|
|
}
|
|
|
|
double :: (x: $T) -> T {
|
|
x + x
|
|
}
|