Closed
Description
With #8849, control flow analysis happens thorough function expression and lambda boundaries for const variables.
it should also be applied to function declarations, class expressions, and class declarations, etc..
so today this works:
const x: number | number[] = []
var cb = function () {
x.push(1)
}
but not this:
const x: number | number[] = []
function cb() {
x.push(1)
}