Skip to content

Review c# 10 feature: explicit return type on lambdas #161

Open

Description

@bjornhellander

Review how the analyzers and code fixes handle lambdas with an explicit return type, e.g. int (x) => x and ref int () => ref field.
See https://learn.microsoft.com/en-us/dotnet/csharp/language-reference/operators/lambda-expressions#explicit-return-type

Things to check:

  • Spacing between the return type and the parameter list (SA1000, SA1008).
  • SA1121 for a built-in type written as its .NET name in the return type, e.g. Int32 (x) => x.
  • SA1130 code fix interaction, and any rule that assumes a lambda starts with its parameter list or with async/static.

Metadata

Metadata

Labels

No labels
No labels

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions