Skip to content

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

Closed
@Strate

Description

@Strate

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'.

Metadata

Metadata

Assignees

No one assigned

    Labels

    DuplicateAn existing issue was already created

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions