TypeScript/tests/cases/conformance/es6/yieldExpressions/generatorNoImplicitReturns.ts

11 lines
180 B
TypeScript

// @target: esnext
// @noImplicitReturns: true
// @strictNullChecks: false
function* testGenerator () {
if (Math.random() > 0.5) {
return;
}
yield 'hello';
}