mirror of
https://github.com/hanzoai/tsgo.git
synced 2026-10-30 19:37:15 +00:00
39 lines
1.3 KiB
Plaintext
39 lines
1.3 KiB
Plaintext
controlFlowDestructuringVariablesInTryCatch.ts(16,1): error TS2454: Variable 'a' is used before being assigned.
|
|
controlFlowDestructuringVariablesInTryCatch.ts(17,1): error TS2454: Variable 'b' is used before being assigned.
|
|
controlFlowDestructuringVariablesInTryCatch.ts(18,1): error TS2454: Variable 'c' is used before being assigned.
|
|
controlFlowDestructuringVariablesInTryCatch.ts(19,1): error TS2454: Variable 'd' is used before being assigned.
|
|
controlFlowDestructuringVariablesInTryCatch.ts(20,1): error TS2454: Variable 'e' is used before being assigned.
|
|
|
|
|
|
==== 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.
|
|
|