Skip to content

IDE0039 is not reported for implicitly typed lambda #68439

@cremor

Description

@cremor

Version Used:
VS 17.6.2

Steps to Reproduce:

  1. Create a new .NET 7 app.
  2. Add a .editorconfig file and set csharp_style_prefer_local_over_anonymous_function = true:warning.
  3. Add the code Func<int, int> test = (int n) => n * 2;.
  4. See that IDE0039 is reported.
  5. Change the code to var test = (int n) => n * 2;

Diagnostic Id:
IDE0039

Expected Behavior:
IDE0039 should be reported for implicitly typed lambdas (or implicitly typed anonymous functions with a block body).

Actual Behavior:
IDE0039 is not reported for implicitly typed lambdas (or implicitly typed anonymous functions with a block body).

Metadata

Metadata

Assignees

No one assigned

    Labels

    Area-IDEuntriagedIssues and PRs which have not yet been triaged by a lead

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions