Skip to content

[Bug]: Lambdas with in parameters throws error #1801

@harry-dickson

Description

@harry-dickson

Description

There is an error with lambdas with in parameters. Using v2.2.0 in VS 2026
Formatting this code fails:

public delegate void MessageTemplateFormatter(in MessageTemplate template, in LogInfo info);

public class Problem
{
    public static void SetPrefixFormatter(MessageTemplateFormatter formatter) { }

    public static Problem()
    {
        SetPrefixFormatter((in template, in info) => { });
    }
}

[Debug - 19/01/2026 10:37:54] File is ignored by .csharpierignore or there was an error

Formats successfully with

    public static Problem()
    {
        SetPrefixFormatter((template, info) => { });
    }

Steps to Reproduce

Try to format code in description

Expected Behavior

No error

Actual Behavior

Formatting failure

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions