Skip to content
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

readonly ref is changed to ref readonly causing error CS9190 #1123

Closed
aurnoi1 opened this issue Jan 14, 2024 · 2 comments · Fixed by #1124
Closed

readonly ref is changed to ref readonly causing error CS9190 #1123

aurnoi1 opened this issue Jan 14, 2024 · 2 comments · Fixed by #1124
Milestone

Comments

@aurnoi1
Copy link

aurnoi1 commented Jan 14, 2024

Hi,

When running chsharpier, readonly ref is changed to ref readonly causing error CS9190.

Version dotnet: net8.0
Version csharpier: 0.26.7

Input:

    public static Result<int> DoSomething(ref readonly Result<int> result)
    {
        return result;
    }

Output:

    public static Result<int> DoSomething(readonly ref Result<int> result)
    {
        return result;
    }

Expected behavior:

    public static Result<int> DoSomething(ref readonly Result<int> result)
    {
        return result;
    }

Thanks!

@belav
Copy link
Owner

belav commented Jan 14, 2024

I modified the sorting modifiers logic to only run on specific nodes to hopefully prevent something like this in the future. Thanks for reporting the problem, it'll be fixed in the coming release!

belav added a commit that referenced this issue Jan 15, 2024
* Only sort modifiers that we know should be sorted.

closes #1123

* formatting files
@aurnoi1
Copy link
Author

aurnoi1 commented Jan 26, 2024

I confirmed that the but is fixed on my side in the last version 0.27.1. Thanks!

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

Successfully merging a pull request may close this issue.

2 participants