Skip to content
ZOLO / TE220 Type · error

await operand is not a Future or Task

Compiler diagnostic TE220: await operand is not a Future or Task.

Why this fires

await received a value whose known type is neither Future<T> nor Task<T>. Awaiting either wrapper produces its T; ordinary values are already available and cannot be suspended.

let value = await 42 // TE220

Fix it

Remove await from an ordinary value, or pass the result of an async fn or spawn expression:

async fn load() -> int { 42 }
let value: int = await load()

Values explicitly typed any remain a gradual boundary and are checked by the runtime. Prefer a concrete Future<T> or Task<T> annotation at API boundaries.

Global index

Find your way through Zolo

Try an idea

Start here

9 results

9 results

en