ToString() is called on an array, which gives its type name and not its elements

tx0/csharp:array-to-stringrecommendedwarningreliability/strings-and-regexdepth fastbug

What it finds

Arrays do not override ToString: values.ToString() gives System.Int32[], whatever the values. string.Join(", ", values) lists them.

From the rule's source, array_to_string.rs.

Example from the rule's tests
class Print{    string Show(int[] values, string name)    {        var a = values.ToString();tx0 reports: values is an array; ToString() gives its type name        return a + string.Join(", ", values) + name.ToString();    }}
Highlighted lines are the ones tx0 reports, with its message under each; the other lines are left alone.

Turn it on, off or suppress it

The rule runs from the recommended tier up. To turn it on in a lower tier, give it a level in tx0.toml:

tx0.toml
[rules]
"tx0/csharp:array-to-string" = "warning"

To keep one finding, suppress it with a reason. tx0 suppress ID --reason "..." writes the comment on the line before the code:

// tx0: ignore[tx0/csharp:array-to-string] reason="..."

tx0 explain tx0/csharp:array-to-string shows the same in the terminal. Found a false positive? Report it.