Files
tsgo/testdata/baselines/reference/submodule/conformance/controlFlowNullishCoalesce.errors.txt

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;
}