-
Notifications
You must be signed in to change notification settings - Fork 4k
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
Changed IDE0059 codefix title in pattern matching #60822
Conversation
.../Core/CodeFixes/RemoveUnusedParametersAndValues/AbstractRemoveUnusedValuesCodeFixProvider.cs
Show resolved
Hide resolved
@DoctorKrolic Answered on Discord. Thanks! :) |
@CyrusNajmabadi please review |
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.
Thanks!
Head branch was pushed to by a user without write access
@CyrusNajmabadi I checked failing integration tests and found out, that class Program
{
public static void Main()
{
var x = new Program();
}
}
class Program
{
public static void Main()
{
var _ = new Program();
}
} So the decision of whether should node be removed or changed to discard is fully implemented in codefixe's code. This method replaces all declaration patterns with type declarations: Lines 79 to 93 in afe689a
So in cases like var a = "str";
if (a is object obj)
{
} declaration pattern Considering this fact, I reverted logic of PR back to just checking for declaration pattern when deciding what codefix title to show |
@CyrusNajmabadi PTAL |
Thanks :) |
Fixes: #40002