Skip to content
ZOLO / TE231 Type · error

async iteration requires an awaitable optional next result and cleanup

Compiler diagnostic TE231: async iteration requires an awaitable optional next result and cleanup.

for await item in source requires a known next() -> Future<T?> or Task<T?> method. Every iteration awaits one item; nil ends iteration. The source must additionally implement canonical core::cleanup::Cleanup so completion, break, return, rejection and cancellation release its resources.

Implement the async next method with a precise optional return type and implement Cleanup::close. An ordinary synchronous iterable uses for item in source.

Global index

Find your way through Zolo

Try an idea

Start here

9 results

9 results

en