JetBrains Rider 2026.2 Help

Code inspection: Redundant empty 'with()'

This inspection reports an empty with() element in a C# collection expression. An empty with() does not pass constructor arguments and does not change the collection contents, so it can be removed.

Example

using System.Collections.Generic; List<int> numbers = [with(), 1, 2, 3];
using System.Collections.Generic; List<int> numbers = [1, 2, 3];

Quick-fix

Remove the empty with() element from the collection expression.

19 June 2026