Diagnostic ID: CA1845: Use span-based 'string.Concat'
Describe the bug
When concatenating substring calls, CA1845 is triggered. However, when it is triggered inside of an expression tree, the fix for CA1845 (using String.Concat() with .AsSpan()) results in the error: CS8640: Expression tree cannot contain value of ref struct or restricted type.
Expected behavior
I would expect the CA1845 to not trigger in the context of an expression tree.
Actual behavior
The rule is triggered, and results in a complier error when fix is applied.
Analyzer
Diagnostic ID: CA1845:
Use span-based 'string.Concat'
Describe the bug
When concatenating substring calls, CA1845 is triggered. However, when it is triggered inside of an expression tree, the fix for CA1845 (using String.Concat() with .AsSpan()) results in the error: CS8640:
Expression tree cannot contain value of ref struct or restricted type
.Expected behavior
I would expect the CA1845 to not trigger in the context of an expression tree.
Actual behavior
The rule is triggered, and results in a complier error when fix is applied.