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

SA1010 conflicts with SA1024 when invoking a method using named arguments with collection expression #3865

Closed
a-herbst opened this issue Jun 27, 2024 · 3 comments

Comments

@a-herbst
Copy link

a-herbst commented Jun 27, 2024

The call of the ShiftValues() method in the example below raises either a SA1010 issue:
ShiftValues(values: [1, 2, 3], offset: 3);

or - if you remove the space character - a SA1024 issue:
ShiftValues(values:[1, 2, 3], offset: 3);

using System.Linq;

namespace PriceCalculationContext.DomainServices;
public class Program
{
    private static int[] ShiftValues(int[] values, int offset)
        => values.Select(v => v + offset).ToArray();

    public static void Main()
    {
        ShiftValues(values: [1, 2, 3], offset: 3);
    }
}
@a-herbst a-herbst changed the title SA1010 conflicts with SA1024 when invoking a method using named arguments SA1010 conflicts with SA1024 when invoking a method using named arguments with collection expression Jun 27, 2024
@a-herbst
Copy link
Author

This happens in 1.2.0-beta556

@bjornhellander
Copy link
Contributor

Can't reproduct this. I see it when using 1.2.0-beta507, but not with beta 556.
Seems consistent with the fix for #3687.

@a-herbst
Copy link
Author

You are right, I had a another project in my solution that still used the older beta version 354 and that caused these issues.

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

No branches or pull requests

3 participants