Version Used:
Steps to Reproduce:
For the following code:
class Command: List<int>;
var commands = new[] {1,2,3,4,5,6,7,8 }
.Chunk(3)
.Select(chunk => (Command)([.. chunk]))
.ToList();
IDE0047 suggest removing parentheses:
class Command: List<int>;
var commands = new[] {1,2,3,4,5,6,7,8 }
.Chunk(3)
.Select(chunk => (Command)[.. chunk])
.ToList();
Which is invalid C# code.
Diagnostic Id:
IDE0047
Expected Behavior:
IDE0047 shouldn't suggest removing parentheses if that leads to invalid code.
Actual Behavior:
IDE0047 suggests removing parentheses when that leads to invalid code.