Fixes #37008 Note that referencing a variable in its initializer is a TDZ error; the OP report had OOB logic that prevented this in practice (?)
7 lines
191 B
TypeScript
7 lines
191 B
TypeScript
// @strictNullChecks: true
|
|
|
|
// Constructed repro
|
|
function fn1(x: number | undefined = x > 0 ? x : 0) { }
|
|
|
|
// Report from user
|
|
function fn2(x?: string = someCondition ? 'value1' : x) { } |