ReSharper 2026.3 Help

コードインスペクション: 冗長な空の 'with()'

このインスペクションは、C# のコレクション式で空の with() 要素を報告します。 空の with() はコンストラクター引数を渡さず、コレクションの内容にも影響しないため、削除できます。

サンプル

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

クイックフィックス

コレクション式から空の with() 要素を削除してください。

2026 年 11 月 6 日