Skip to content

Unexpected Operator '===' cannot be applied to types 'false' and 'true'. #13229

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
Strate opened this issue Dec 30, 2016 · 2 comments
Closed
Labels
Duplicate An existing issue was already created

Comments

@Strate
Copy link

Strate commented Dec 30, 2016

TypeScript Version: 2.1.4

Code

let a = false
function change() {
  a = true
}
change()
const b = a === true

Expected behavior:
No error

Actual behavior:
error TS2365: Operator '===' cannot be applied to types 'false' and 'true'.

@RyanCavanaugh RyanCavanaugh added the Duplicate An existing issue was already created label Dec 30, 2016
@RyanCavanaugh
Copy link
Member

See #9998. Can I ask how you didn't find #11178 or #12772 when searching?

@Strate
Copy link
Author

Strate commented Dec 30, 2016

@RyanCavanaugh sorry for that, I thought that '==' and '===' is notable difference for that case.

@Strate Strate closed this as completed Dec 30, 2016
@microsoft microsoft locked and limited conversation to collaborators Jun 19, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Duplicate An existing issue was already created
Projects
None yet
Development

No branches or pull requests

2 participants