question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Flag boolean in comparison operator operands as errors

See original GitHub issue

From https://github.com/Microsoft/TypeScript/issues/15444#issuecomment-298055832

var x: boolean, y: boolean;
if (x > y) {  // suspicious!
}

Issue Analytics

  • State:open
  • Created 6 years ago
  • Comments:11 (6 by maintainers)

github_iconTop GitHub Comments

3reactions
gcnewcommented, Jun 14, 2017

Maybe late to the party, but I think Date should be comparable as well. It’s true that the arithmetic operators yield strange results, but AFAIK the relational ones do not and are frequently used in JS sources.

2reactions
RyanCavanaughcommented, May 10, 2017

Speaking of which, are Date objects comparable because of spec magic

Extreme spec magic; see https://github.com/Microsoft/TypeScript/issues/2361#issuecomment-82509802

Read more comments on GitHub >

github_iconTop Results From Across the Web

5.1: Boolean Data and Operators - Engineering LibreTexts
The boolean EXCLUSIVE-OR operation (column 5 of Table 5.1) is a binary operation, which differs from the OR operator in that it is...
Read more >
Database PL/SQL Language Reference - Oracle Help Center
The IS NULL operator returns the BOOLEAN value TRUE if its operand is NULL or FALSE if it is not NULL . The...
Read more >
about Comparison Operators - PowerShell | Microsoft Learn
Describes the operators that compare values in PowerShell. ... input of an operator is a scalar value, the operator returns a Boolean value....
Read more >
How can I declare and use Boolean variables in a shell script?
The = operator is bash's string comparison operator. ... bash: "true": syntax error: operand expected (error token is ""true"") sh (dash): sh: 1:...
Read more >
Java Gotchas - Bitwise vs Boolean Operators
Using Bitwise operators with Booleans is perfectly valid, so Java will not report a syntax error. If I construct a JUnit Test to...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found