116. Type arguments on a receiver fill a list-form fn's generics; they never pick another fn (2026-11-21)
- Decision.
Graph<V>.undirected(pairs)resolves to the sameundirected_of_pairs/_of_triplesfn asGraph.undirected(pairs), in the checker (list_form) and in lowering (list_form_call). Type arguments on the receiver fill the fn's like-named generics (V), soGraph<V>.undirected([(1, 2)])is an error saying it wants aList<(V, V)>. A pattern form naming fields (for (u, v, w: weight) in edges) was considered and not added: names are written once where the data enters (read<[m](u: V, v: V, w: Int)>()), and no dream or friction report uses it (open question inspec/lib/rationale/graphs.md). - Also (no new rule). The checker's existing positional-to-named fit (
(V, V)fits(u: V, v: V)) now reaches through optionals (?(Int, Int)fits?(a: Int, b: Int)), and lowering retypes in place a value whose type differs from the wanted one only in tuple field names (same_cells, through arrays, optionals and lists). Both back ends hold tuples and records the same way, asstd::tuplein C++ and a tuple value in the interpreter, so this is free.[n](Int, Int)into[n](a: Int, b: Int)used to be rejected in lowering. Swapped field types still do not fit (tests/diagnostics/named_tuple_cells_keep_their_order). Reverse by droppingsame_cellsfromlower/mod.rsandlower/stmt.rsand theOptional/Optionalarm fromTy::fits_in. - Why. Four dreams (cf2035f, cf2057e2, cf2150f, cf2152g) write
Graph<V>.undirected(read<[n](V, V)>()). That skipped the pair-list fn and fell through to the declared-edge-domain form, so writing a type argument changed which fn ran. - Reverse. Restore the bare-name-only
list_formincpl-check/src/check/call.rs, and inlinelist_form_callback into the unparameterized branch ofcpl-ir/src/lower/call.rs.