Skip to content

Error 2367 could be wrong #49066

Closed
Closed
@Raffaello

Description

@Raffaello

Bug Report

🔎 Search Terms

🕗 Version & Regression Information

  • This is a crash
  • This changed between versions ______ and _______
  • This is the behavior in every version I tried, and I reviewed the FAQ for entries about _________
  • I was unable to test this on prior versions because _______

⏯ Playground Link

Playground link with relevant code
https://www.typescriptlang.org/play?&msclkid=9d535d68d12a11ecae6af6576a43aaf2#code/MYewdgzgLgBAljAvDA5AFgAwEYVOZrAKFEhABsBTAOjJAHMAKOASiA

💻 Code

// We can quickly address your report if:
//  - The code sample is short. Nearly all TypeScript bugs can be demonstrated in 20-30 lines of code!
//  - It doesn't use external libraries. These are often issues with the type definitions rather than TypeScript bugs.
//  - The incorrectness of the behavior is readily apparent from reading the sample.
// Reports are slower to investigate if:
//  - We have to pare too much extraneous code.
//  - We have to clone a large repo and validate that the problem isn't elsewhere.
//  - The sample is confusing or doesn't clearly demonstrate what's wrong.
// TS2367 (wrong) error
console.log('401' == 401)

🙁 Actual behavior

compiler says it is always false like if it was with triple equals, instead is true with double equal.

🙂 Expected behavior

well it should not report the error in this case

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