-
Notifications
You must be signed in to change notification settings - Fork 12.6k
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
Flag boolean in comparison operator operands as errors #15506
Comments
Well, that is the most concise way of writing: let x: boolean, y: boolean;
if (x && !y) {
} |
Accepting PRs: Disallow non- |
Should At least I have used it in the past to indicate a "comparable" that was not |
Could you elaborate on the scenario? What was the run-time value supposed to be? |
In this specific case, it was a function that received a function that produces an ordered list of sorting keys; where the value of the sorting keys are anything comparable. As the function doesn't need the keys to be anything in particular (besides comparable), they were typed as Speaking of which, are |
Extreme spec magic; see #2361 (comment) |
I've just taken a stab at this issue. The conformance tests for comparison operators work as expected. However, a few tests still fail, such as:
... or ...
Am I right to assume that this is an issue with (graceful) parsing? If so, should I deal with this in a new issue? I've not opened a PR yet, BTW. Can do though if you prefer to. Any guidance is much appreciated 🙂 |
yes. |
Maybe late to the party, but I think |
@gcnew Came here from issue #17119 As the comments stand now, I don't think this issue is a clear duplicate, and if we're keeping addressing that issue in this thread, then at least I want to make it clear. As the reporter @adius said, it would be nice if typescript produced a warning for below ( d1 === d2
d1 == d2 As @gcnew pointed out |
Working on this, I’ll follow up with a PR via Bloomberg in the by Monday |
I would love to work on this if no one hasn't already or working on it now with a bit a of help!! |
I want to work with on it, can I ? |
From #15444 (comment)
The text was updated successfully, but these errors were encountered: