forked from microsoft/TypeScript
/
controlFlowDestructuringVariablesInTryCatch.errors.txt
39 lines (33 loc) · 1.46 KB
/
controlFlowDestructuringVariablesInTryCatch.errors.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
tests/cases/compiler/controlFlowDestructuringVariablesInTryCatch.ts(16,1): error TS2454: Variable 'a' is used before being assigned.
tests/cases/compiler/controlFlowDestructuringVariablesInTryCatch.ts(17,1): error TS2454: Variable 'b' is used before being assigned.
tests/cases/compiler/controlFlowDestructuringVariablesInTryCatch.ts(18,1): error TS2454: Variable 'c' is used before being assigned.
tests/cases/compiler/controlFlowDestructuringVariablesInTryCatch.ts(19,1): error TS2454: Variable 'd' is used before being assigned.
tests/cases/compiler/controlFlowDestructuringVariablesInTryCatch.ts(20,1): error TS2454: Variable 'e' is used before being assigned.
==== tests/cases/compiler/controlFlowDestructuringVariablesInTryCatch.ts (5 errors) ====
declare function f1(): string;
declare function f2(): [b: string];
declare function f3(): { c: string };
try {
var a = f1();
var [b] = f2();
var { c } = f3();
var [d = 1] = [];
var { e = 1 } = { };
} catch {
console.error("error");
}
a;
~
!!! error TS2454: Variable 'a' is used before being assigned.
b;
~
!!! error TS2454: Variable 'b' is used before being assigned.
c;
~
!!! error TS2454: Variable 'c' is used before being assigned.
d;
~
!!! error TS2454: Variable 'd' is used before being assigned.
e;
~
!!! error TS2454: Variable 'e' is used before being assigned.