Skip to content

ZNTC0906: 'yield' expression is not allowed in formal parameters

‘yield’ expression is not allowed in formal parameters

Category: Parser: Await/Yield/JSX/TS

function* g(x = yield 1) {}

Reproduce in Playground →

See the error message for cause and resolution.