mirror of
https://github.com/hanzoai/tsgo.git
synced 2026-10-30 19:37:15 +00:00
19 lines
490 B
Plaintext
19 lines
490 B
Plaintext
controlFlowNullishCoalesce.ts(4,1): error TS2454: Variable 'a' is used before being assigned.
|
|
|
|
|
|
==== controlFlowNullishCoalesce.ts (1 errors) ====
|
|
// assignments in shortcutting rhs
|
|
let a: number;
|
|
o ?? (a = 1);
|
|
a.toString();
|
|
~
|
|
!!! error TS2454: Variable 'a' is used before being assigned.
|
|
|
|
// assignment flow
|
|
declare const o: { x: number } | undefined;
|
|
let x: { x: number } | boolean;
|
|
if (x = o ?? true) {
|
|
x;
|
|
}
|
|
|
|
|