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
A tuple element type through a generic facade's &T view: field access fails inference, and a call-contract BUG in MirLower on the benchmark's shape #2565
A tuple as a facade's element type breaks two ways where a record works.
use std.collections.deque.Deque
fn main:
var d = Deque[(i32, i32)].new()
d.push_back((1, 2))
print(d.get(0).0)
gives cannot infer type parameter 'T' for this call; the argument's shape does not match the parameter type that mentions 'T' at the print (Deque.get returns &T, here &(i32, i32), and .0 through that view does not type). The same shape in test/benchmark/stc_engines.w's slot-shape round (var d = Deque[(i32, i32)].new(), d.push_back((i, i)), d.get(i as isize).0 as i64) fails later and harder:
BUG: user generic call lacks a concrete contract: body=14306(deque_slots_round) call=0 node=580099 sig=-1 mono=0 [src/MirLower.w:19465 MirModule.validate_generic_call_contracts]
With type Pair { a: i32, b: i32 } in place of the tuple both compile and run (the benchmark uses Pair now). A tuple element in a List ([(1, 2)], .0 on xs[0]) works, so it is the generic method's &T view of a tuple, not tuples in containers.
Route: with analyze repro.w 'explain:origin:main' for the view, then audit:resolution on the benchmark's shape for the missing contract.
Fixed in #2614 (main 23dd9db). Root cause: a tuple type argument at a static call (Deque[(i32, i32)].new()) parses as a tuple expression in type-level position, which resolve_type_level_arg_expr did not resolve; the instance then had no concrete argument, its methods no specialization contract (the MirLower BUG) and the view's field no type (the inference error). The same type in an annotation always worked. Fixture test/behavior/behav_tuple_type_argument.w.
Activity
docs: stdlib_sourcing_plan reflects the implemented state (all four p…
Stdlib sourcing close-out: Stack/Queue/LinkedList, stable_sort/shuffl…
ehartford commentedon Oct 24, 2026
Fixed in #2614 (main 23dd9db). Root cause: a tuple type argument at a static call (Deque[(i32, i32)].new()) parses as a tuple expression in type-level position, which resolve_type_level_arg_expr did not resolve; the instance then had no concrete argument, its methods no specialization contract (the MirLower BUG) and the view's field no type (the inference error). The same type in an annotation always worked. Fixture test/behavior/behav_tuple_type_argument.w.