Skip to content

Parser should allow lambdas with ref return types in assignments without requiring parentheses #54258

@cston

Description

@cston

The initializers for d1 and d2 should be equivalent. Currently, the initializer for d2 is interpreted as ref (int () => x) and is reported as an error.

delegate ref int D();

class Program
{
    static void Main()
    {
        D d1 = (ref int () => x);
        D d2 = ref int () => x;
    }
}

See LDM notes.

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions