Skip to content

Unexpected error: This condition will always return 'false' since the types 'boolean' and 'number' have no overlap.(2367) #35925

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

Closed
mhevery opened this issue Dec 30, 2019 · 0 comments
Labels
Won't Fix The severity and priority of this issue do not warrant the time or complexity needed to fix it

Comments

@mhevery
Copy link

mhevery commented Dec 30, 2019

TypeScript Version: 3.7.2

Search Terms:

Code

if (true == 1) console.log('This will always execute because of type coercion, TypeScript error is wrong.');
if (true === 1) console.log('This will never execute because error is correct.');

Expected behavior:
if(true == 1) should not produce an error as it is true in JS.

Actual behavior:
if(true == 1) produce this error This condition will always return 'false' since the types 'boolean' and 'number' have no overlap.(2367)

Playground Link:
Playground

Related Issues:
#35567

@RyanCavanaugh RyanCavanaugh added the Won't Fix The severity and priority of this issue do not warrant the time or complexity needed to fix it label Jan 13, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Won't Fix The severity and priority of this issue do not warrant the time or complexity needed to fix it
Projects
None yet
Development

No branches or pull requests

2 participants