|
| 1 | +//// [tests/cases/compiler/controlFlowForStatementContinueIntoIncrementor1.ts] //// |
| 2 | + |
| 3 | +=== controlFlowForStatementContinueIntoIncrementor1.ts === |
| 4 | +// https://github.com/microsoft/TypeScript/issues/60945 |
| 5 | + |
| 6 | +{ |
| 7 | + let iNext; |
| 8 | +>iNext : Symbol(iNext, Decl(controlFlowForStatementContinueIntoIncrementor1.ts, 3, 5)) |
| 9 | + |
| 10 | + for ( |
| 11 | + let i = 0; |
| 12 | +>i : Symbol(i, Decl(controlFlowForStatementContinueIntoIncrementor1.ts, 5, 7)) |
| 13 | + |
| 14 | + i < 10; |
| 15 | +>i : Symbol(i, Decl(controlFlowForStatementContinueIntoIncrementor1.ts, 5, 7)) |
| 16 | + |
| 17 | + i = iNext // error |
| 18 | +>i : Symbol(i, Decl(controlFlowForStatementContinueIntoIncrementor1.ts, 5, 7)) |
| 19 | +>iNext : Symbol(iNext, Decl(controlFlowForStatementContinueIntoIncrementor1.ts, 3, 5)) |
| 20 | + |
| 21 | + ) { |
| 22 | + if (i == 5) { |
| 23 | +>i : Symbol(i, Decl(controlFlowForStatementContinueIntoIncrementor1.ts, 5, 7)) |
| 24 | + |
| 25 | + iNext = "bad"; |
| 26 | +>iNext : Symbol(iNext, Decl(controlFlowForStatementContinueIntoIncrementor1.ts, 3, 5)) |
| 27 | + |
| 28 | + continue; |
| 29 | + } |
| 30 | + iNext = i + 1; |
| 31 | +>iNext : Symbol(iNext, Decl(controlFlowForStatementContinueIntoIncrementor1.ts, 3, 5)) |
| 32 | +>i : Symbol(i, Decl(controlFlowForStatementContinueIntoIncrementor1.ts, 5, 7)) |
| 33 | + } |
| 34 | +} |
| 35 | + |
| 36 | +{ |
| 37 | + let iNext: string | number = ""; |
| 38 | +>iNext : Symbol(iNext, Decl(controlFlowForStatementContinueIntoIncrementor1.ts, 18, 5)) |
| 39 | + |
| 40 | + for ( |
| 41 | + let i = 0; |
| 42 | +>i : Symbol(i, Decl(controlFlowForStatementContinueIntoIncrementor1.ts, 20, 7)) |
| 43 | + |
| 44 | + i < 10; |
| 45 | +>i : Symbol(i, Decl(controlFlowForStatementContinueIntoIncrementor1.ts, 20, 7)) |
| 46 | + |
| 47 | + i = iNext // error |
| 48 | +>i : Symbol(i, Decl(controlFlowForStatementContinueIntoIncrementor1.ts, 20, 7)) |
| 49 | +>iNext : Symbol(iNext, Decl(controlFlowForStatementContinueIntoIncrementor1.ts, 18, 5)) |
| 50 | + |
| 51 | + ) { |
| 52 | + if (i == 5) { |
| 53 | +>i : Symbol(i, Decl(controlFlowForStatementContinueIntoIncrementor1.ts, 20, 7)) |
| 54 | + |
| 55 | + iNext = "bad"; |
| 56 | +>iNext : Symbol(iNext, Decl(controlFlowForStatementContinueIntoIncrementor1.ts, 18, 5)) |
| 57 | + |
| 58 | + continue; |
| 59 | + } |
| 60 | + iNext = i + 1; |
| 61 | +>iNext : Symbol(iNext, Decl(controlFlowForStatementContinueIntoIncrementor1.ts, 18, 5)) |
| 62 | +>i : Symbol(i, Decl(controlFlowForStatementContinueIntoIncrementor1.ts, 20, 7)) |
| 63 | + } |
| 64 | +} |
| 65 | + |
0 commit comments