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

"Delegate invocation can be simplified" is shown on non-delegates #76422

Closed
jnm2 opened this issue Dec 13, 2024 · 0 comments · Fixed by #76427
Closed

"Delegate invocation can be simplified" is shown on non-delegates #76422

jnm2 opened this issue Dec 13, 2024 · 0 comments · Fixed by #76427
Labels

Comments

@jnm2
Copy link
Contributor

jnm2 commented Dec 13, 2024

Version Used: 17.13.0 Preview 2.0

The following code produces "ℹ️ IDE1005 Delegate invocation can be simplified," but this is not delegate invocation. Nothing needs to be shown here, because this refactoring is duplicative of the "Null check can be simplified" that is also offered on the same line.

var expr = new C();
if (expr != null) expr.Invoke();

class C
{
    public void Invoke() { }
}
@dotnet-issue-labeler dotnet-issue-labeler bot added Area-IDE untriaged Issues and PRs which have not yet been triaged by a lead labels Dec 13, 2024
@dotnet-policy-service dotnet-policy-service bot removed the untriaged Issues and PRs which have not yet been triaged by a lead label Dec 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant