# MWE: Input: some type and an array. Output: length of array
template foo[T; N: static int](shape: static[array[N, int]]): untyped = N
const Z = foo[float, 2]([2,3]) # it works
const Z = foo[float]([2,3]) # Error: missing generic parameter: N
template foo2[N: static int](shape: static[array[N, int]]): untyped = N
const Z = foo2([2,3]) # it works
template foo3[N: static int](T: typedesc, shape: static[array[N, int]]): untyped = N
const Z = foo3(float, [2,3]) # it works
Can't some generic parameters be inferred from arguments when we manually define others (float in the example)? If I remove T and float, it works. I also works if I move T and float to the argument side. It looks like it's all (infer everything) or nothing (manually input everything), there is no "partial inference".
Thinking twice, if partial inference would be provided, how could we use it? In an complicated case
foo[T1; N; T2](shape: static[array[N, int]]): untyped = N Could it be foo[float; T2:4]([2,3])? Would we follow some ordering (e.g., inferable first)?