Skip to content
ZOLO / TE223 Type · error

generator yield type mismatch

Compiler diagnostic TE223: generator yield type mismatch.

Why this fires

A yield value does not satisfy the generator's declared element type. Every yield in fn* ... -> T must produce a value assignable to T.

fn* ids() -> int {
    yield 1
    yield "two" // TE223
}

Fix it

Change the value to the declared type, or change the return annotation when the generator intentionally produces another type. Without an annotation, Zolo joins evidence from all yields conservatively.

Global index

Find your way through Zolo

Try an idea

Start here

9 results

9 results

en