Skip to content

RCS1250 fixer generates invalid syntax for Dictionaries #1641

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

Open
prezaei opened this issue Mar 27, 2025 · 1 comment · May be fixed by #1652
Open

RCS1250 fixer generates invalid syntax for Dictionaries #1641

prezaei opened this issue Mar 27, 2025 · 1 comment · May be fixed by #1652

Comments

@prezaei
Copy link

prezaei commented Mar 27, 2025

If roslynator_use_collection_expression = true, the code below generates an invalid syntax:

    private static readonly Dictionary<GroundingDataSize, int> Sizes = new()
    {
        { GroundingDataSize.Small, 5 },
        { GroundingDataSize.Medium, 20 },
        { GroundingDataSize.Large, 100 }
    };

Generates this:

    private static readonly Dictionary<GroundingDataSize, int> Sizes = [
        { GroundingDataSize.Small, 5 },
        { GroundingDataSize.Medium, 20 },
        { GroundingDataSize.Large, 100 }
    ];
@florinlacatus98
Copy link

Image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants