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
E0951 refuses it * it: a second use of the implicit parameter is read as a nested closure #2545
it * it (the implicit parameter used twice in one closure body) is refused as a nested implicit closure:
fn main:
let xs = [1, 2, 3]
let sq = xs |> map(it * it) |> collect[List]()
print(f"{sq[2]}")
v0.15.3.0-g5e0bd9076:
error: nested implicit closure is ambiguous; use explicit parameter for inner closure [E0951]
--> it_it.w:3:29
3 | let sq = xs |> map(it * it) |> collect[List]()
| ^^
E0951 (§9, §29.12) is for an implicit it inside a closure nested in another implicit closure. it * it has one closure and one it, used twice: the second use must read the same parameter. Expected: 9. The same body spelled x => x * x works.
Fixed on main (b050a01, PR #2587, stack #2588): one commit with the fixture test/behavior/behav_2545_it_closure_per_argument.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
`it` opens one implicit closure per call argument (#2545)
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_2545_it_closure_per_argument.w, which failed before the fix and passes after; battery GREEN on the stack top 077d684 (669 s, pinned seed nightly-20261023-local-1).