TypeScript/tests/cases/conformance/es6/yieldExpressions/yieldExpressionInControlFlow.ts
Nathan Shively-Sanders 9025bc7c69
Fix control flow loop in yield expression (#25228)
* Fix control flow loop in yield expression

Yet again, the fix is to stop using checkExpressionCached.

* Update lib in test to reduce number of errors
2018-06-26 12:50:29 -07:00

22 lines
326 B
TypeScript

// @noEmit: true
// @allowJs: true
// @checkJs: true
// @noImplicitAny: true
// @lib: esnext
// @Filename: bug25149.js
function* f() {
var o
while (true) {
o = yield o
}
}
// @Filename: alsoFails.ts
// fails in Typescript too
function* g() {
var o = []
while (true) {
o = yield* o
}
}