Skip to content
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

Unused variable lambda #108

Merged
merged 4 commits into from
May 21, 2020
Merged

Unused variable lambda #108

merged 4 commits into from
May 21, 2020

Conversation

PandaMagnus
Copy link
Contributor

Fix #104

@Keboo Keboo added this to the 0.1.7 milestone May 21, 2020
}

[TestMethod]
public void LambdaMethodWithDiscard_NoDiagnosticInformationReturned()
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Isn't this the same as the first test? Should this be testing the opposite case confirming the un-used lambda parameters are flagged

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I honestly wasn't sure, so figured I'd err on the side of caution. :) If having or not having braces is fundamentally the same, I can remove the test.

But, yes, I did forget to add tests for the opposite case. I will do that now!

@Keboo
Copy link
Member

Keboo commented May 21, 2020

Just for posterity this solution aligns with the C# 9.0 candidate feature for allowing lambda discard parameters. dotnet/csharplang#111

@Keboo Keboo merged commit 8b89179 into master May 21, 2020
@Keboo Keboo deleted the unused-variable-lambda branch May 21, 2020 18:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

INTL0303 flags delegates declared with a lambda expression
2 participants