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
Iterator adapters (.zip, .map, .filter, …) exist only for built-in iterator types; a user type implementing Iter[T] has none (§13.3) #1746
Spec: §13.2 ("for loops, .zip(), .peekable(), .windows() — all work as you'd expect"), §13.3 (collection operations over any Iter[T]).
Found by the #1725g.pull() work: .zip(), .map() and the other iterator adapters are special-cased in codegen for the built-in iterator types only. A user type that implements Iter[T] — including std's new Pulled[T] from g.pull() — gets "unknown method" for them. The pull tests pair two pulled generators through a generic function over Iter[T] instead of a.zip(b).
Expected: every adapter §13.3 defines works on any Iter[T] implementor, written once in std over the trait rather than per built-in type in codegen (D65: the method set is a Sema/std fact, not a codegen special case).
Fixed on main by 9307016 (#1965): the §13.3 adapters are written once as iter_<name> fns in std.traits over any impl Iter[T]; Sema resolves recv.name(args) / recv |> name(args) on a type with a declared next() and no intrinsic adapter (built-in iterators keep their intrinsics). Fixture behav_1746_user_iter_adapters.w (zip/filter/map/collect/enumerate/fold/take/count/any/chain/take_while/position on a user Iter[T] and on Pulled). Battery green.
Activity
Iterator adapters work on any Iter[T] implementor (#1746)
A built-in iterator keeps its intrinsic adapters; the Iter[T] dispatc…
Iterator adapters work on any Iter[T] implementor (#1746)
A built-in iterator keeps its intrinsic adapters; the Iter[T] dispatc…
Iterator adapters work on any Iter[T] implementor (#1746)
A built-in iterator keeps its intrinsic adapters; the Iter[T] dispatc…
D70 namespaced types reachable when shadowed (#1757); generator stage…
ehartford commentedon Oct 3, 2026
Fixed on main by 9307016 (#1965): the §13.3 adapters are written once as
iter_<name>fns in std.traits over anyimpl Iter[T]; Sema resolvesrecv.name(args)/recv |> name(args)on a type with a declarednext()and no intrinsic adapter (built-in iterators keep their intrinsics). Fixture behav_1746_user_iter_adapters.w (zip/filter/map/collect/enumerate/fold/take/count/any/chain/take_while/position on a user Iter[T] and on Pulled). Battery green.