Skip to content

Improve error message for == of two different types #27227

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

Closed
wants to merge 4 commits into from
Closed

Conversation

ghost
Copy link

@ghost ghost commented Sep 19, 2018

Fixes #26592

@ghost ghost requested a review from DanielRosenwasser September 19, 2018 23:55
@ghost ghost force-pushed the equals_error branch from 7f039c9 to a57c9a7 Compare September 19, 2018 23:57
@ghost ghost force-pushed the equals_error branch from a57c9a7 to b36e5de Compare September 20, 2018 00:37
@iliashkolyar
Copy link
Contributor

@Andy-MS
If i'm not mistaken, this fix will not handle literal type comparisons such as:

var a = (1 == "1");
var b = ("" == 0);
var c = (false == "");
var d = (false == 0);

All of the above are also runtime comparisons that will yield "This condition will always return 'false'" mistakenly.

@ghost ghost force-pushed the equals_error branch from 3622e9a to 107cb98 Compare September 20, 2018 23:17
@ghost
Copy link
Author

ghost commented Oct 22, 2018

@DanielRosenwasser Please review

@ghost ghost force-pushed the equals_error branch from 3321364 to 405478e Compare November 16, 2018 01:11
@sandersn sandersn added the For Backlog Bug PRs that fix a backlog bug label Feb 1, 2020
@sandersn sandersn requested review from elibarzilay and orta March 10, 2020 00:05
@elibarzilay
Copy link
Contributor

elibarzilay commented Jul 21, 2020

I rebased it up the history in small steps, and it worked fine with obvious fixes, until 48fc6b8 (from #32239) which edits the same code to something different, so making this work will require actually redoing it. (It looks like the main issue is that 48fc6b8 extends tryGiveBetterPrimaryError whereas this one removes it.)

@elibarzilay
Copy link
Contributor

Talked to @RyanCavanaugh, seems not worth the effort of reviving.

@RyanCavanaugh RyanCavanaugh deleted the equals_error branch October 25, 2022 20:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
For Backlog Bug PRs that fix a backlog bug
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

"This condition will always return 'false'" but returns true at runtime
4 participants