swc/crates/swc_ecma_parser/tests/tsc/controlFlowForInStatement.ts
2022-02-04 17:08:38 +09:00

18 lines
283 B
TypeScript

let x: string | number | boolean | RegExp | Function;
let obj: any;
let cond: boolean;
x = /a/;
for (let y in obj) {
x = y;
if (cond) {
x = 42;
continue;
}
if (cond) {
x = true;
break;
}
}
x; // RegExp | string | number | boolean