-
Notifications
You must be signed in to change notification settings - Fork 13k
Closed
Labels
Working as IntendedThe behavior described is the intended behavior; this is not a bugThe behavior described is the intended behavior; this is not a bug
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)
}
Metadata
Metadata
Assignees
Labels
Working as IntendedThe behavior described is the intended behavior; this is not a bugThe behavior described is the intended behavior; this is not a bug