You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Generic call: a bracket literal takes no array parameter demand (f[T](xs: [T; 3]) called f([7, 8, 9]) cannot infer T) #2379
Actual: cannot infer type parameter 'T' for this call; the argument's shape does not match the parameter type that mentions 'T'. The non-generic twin (fn f(xs: [i32; 3])) compiles and prints 7; naming the array first (let a: [i32; 3] = [7, 8, 9]; f(a)) also works.
Cause, from the #2311 work: check_call types the literal with no demand (List[isize], D113), then check_generic_call binds only from arg types via bind_type_params_from_type_expr, whose NK_TYPE_ARRAY case requires a TY_ARRAY argument. The fix shape: bind from the literal's syntax where the demand is an array type — element type from the literal's elements, lengths (D119 Amendment 1) from their counts — or type the literal under the template's array demand before binding. Found while writing behav_d119a1_array_length_generics, which uses named arrays until this lands.
Fixed on main (b050a01, PR #2587, stack #2588): one commit with the fixture test/behavior/behav_2379_array_param_from_bracket_literal.w, which failed before the fix and passes after; battery GREEN on the stack top 077d684 (669 s, pinned seed nightly-20261023-local-1).
Activity
D119 Amendment 1 (#2311): Vector[T, N] element-first + array-length g…
docs: D119 records that the Vector[T, N] rename and array-length gene…
A bracket literal argument binds and takes a generic array parameter (#…
Six fixes from the issue backlog: #2545, #2524, #2334, #2325, #2443, #…
ehartford commentedon Oct 23, 2026
Fixed on main (b050a01, PR #2587, stack #2588): one commit with the fixture
test/behavior/behav_2379_array_param_from_bracket_literal.w, which failed before the fix and passes after; battery GREEN on the stack top 077d684 (669 s, pinned seed nightly-20261023-local-1).