mirror of
https://github.com/hanzoai/tsgo.git
synced 2026-10-30 19:37:15 +00:00
31 lines
410 B
TypeScript
31 lines
410 B
TypeScript
// @strict: true
|
|
// @noEmit: true
|
|
// @allowUnreachableCode: true, false
|
|
|
|
function test1(v: 0 | 1 | 2) {
|
|
for (
|
|
(function () {
|
|
throw new Error("");
|
|
})();
|
|
v;
|
|
v++
|
|
) {
|
|
console.log("1");
|
|
}
|
|
}
|
|
|
|
function test2(v: 0 | 1 | 2) {
|
|
try {
|
|
for (
|
|
(function () {
|
|
throw new Error("");
|
|
})();
|
|
v;
|
|
v++
|
|
) {
|
|
console.log("1");
|
|
}
|
|
} catch (e) {}
|
|
v;
|
|
}
|