Why this fires¶
yield is only valid in a generator declared with fn*. An ordinary or
async fn returns one result; it does not expose a pull iterator.
fn values() { yield 1 } // TE221Fix it¶
Use fn* when the function is intended to produce a sequence:
fn* values() -> int {
yield 1
}Calling this function returns Iter<int>. If only one value is needed, replace
yield value with the function's ordinary return or tail value.