Flag boolean in comparison operator operands as errors
See original GitHub issueFrom https://github.com/Microsoft/TypeScript/issues/15444#issuecomment-298055832
var x: boolean, y: boolean;
if (x > y) { // suspicious!
}
Issue Analytics
- State:
- Created 6 years ago
- Comments:11 (6 by maintainers)
Top 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 >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
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.Extreme spec magic; see https://github.com/Microsoft/TypeScript/issues/2361#issuecomment-82509802