When I call Boolean() function to test a union type, it doesn't have type-guard working.
Here is a simple code and VSCode screenshot.

function test(number: number | undefined) {
if (Boolean(number)) {
console.log(number)
}
}
Duplicate of #16655, and there is an open PR fixing this here: #29955
Most helpful comment
Duplicate of #16655, and there is an open PR fixing this here: #29955