Skip to content

RCS1231 shouldn't trigger when parameter is params #1769

Description

@Sella-GH

Description

Per C# compiler message CS1611 ref or out is not allowed on params. in isn't mentioned specifically but the compiler error triggers when declaring it on params.

Example

public static int Create<T>(params ReadOnlySpan<T> values) // <- this triggers RCS1231
{
    HashCode hash = new();
    foreach (T value in values)
    {
        hash.Add(value);
    }

    return hash.ToHashCode();
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions