-
Notifications
You must be signed in to change notification settings - Fork 4.1k
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
remove _showPosition from DiagnosticDescription #19353
Conversation
@@ -219,13 +217,8 @@ public override bool Equals(object obj) | |||
{ | |||
if (_startPosition.Value != d._startPosition.Value) | |||
{ | |||
_showPosition = true; | |||
d._showPosition = true; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ummm ... why should Equals every be changing state??? You've deleted lines that terrify me.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
RIGHT
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@OmarTawfik can attest: when I found that this was the source of the bug, I cried tears of blood.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It was a hidden gem as old as our history goes ~~
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let us forever burn this mistake into our memories. Today will be remembered as ""In No State chANging Equals" day, or "INSANE" for short.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sounds like good RoslynAnalyzer candidate to check if fields are set in .Equals, .GetHashCode, .ToString... methods
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@DavidKarlas i could forgive it in GetHashCode and ToString as long as it is just caching a lazily computed value to prevent recalc
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I can't decide if I'm more surprised this exists or that everything passes when we remove it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The ETA failure looks real. Apparently the internal code base depends on this
The ETA failure is real. But I think we can simply delete the usage of Need to sync up with @mavasani to make sure. If he agrees we need to coordinate a change between the two repos. |
IOperation unit test generator uses this overload when creating new tests, so it shouldn't affect existing tests. You can get rid of the explicit argument at https://github.com/dotnet/roslyn-internal/blob/master/Closed/Hosting/RoslynETAHost/Diagnostics/Features/IOperation/IOperationUnitTestGenerator.cs#L347 before merging your PR to avoid any breaks. |
PR to resolve the internal break https://github.com/dotnet/roslyn-internal/pull/1831 |
retest eta please |
retest windows_debug_unit32_prtest please |
Justification for retest:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
I understand this is test code, but I'd consider adding a test (feed a couple actual and expected diagnostics, and run a comparison on them).
@jcouv: Yeah, a few tests wouldn't be amiss. Where do we typically put test-tests? |
This is killing me. I'm going to merge now and add tests later. |
Test only change
Closes #17155
_showPosition was really weird.
both
DiagnosticDescriptions if both have locations and both are the same, but only if the method didn't bail out earlier.CC @jcouv @AlekseyTs