Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Boolean() function is not working with type-guard. #30321

Closed
rockmandash opened this issue Mar 11, 2019 · 1 comment
Closed

Boolean() function is not working with type-guard. #30321

rockmandash opened this issue Mar 11, 2019 · 1 comment
Labels
Duplicate An existing issue was already created

Comments

@rockmandash
Copy link

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.

image

function test(number: number | undefined) {
  if (Boolean(number)) {
    console.log(number)
  }
}
@jack-williams
Copy link
Collaborator

Duplicate of #16655, and there is an open PR fixing this here: #29955

@DanielRosenwasser DanielRosenwasser added the Duplicate An existing issue was already created label Mar 11, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Duplicate An existing issue was already created
Projects
None yet
Development

No branches or pull requests

3 participants