コードインスペクション:冗長な明示的なNULL可能型の作成
このインスペクションは、値が直接使用できる場合に、 new int?(value) のような明示的な null 値の生成を報告します。 明示的な new Nullable<T>(...) 形式は、通常の C# コードでは通常冗長です。
サンプル
class C
{
int? GetValue()
{
return new int?(10);
}
}
class C
{
int? GetValue()
{
return 10;
}
}
クイックフィックス
この応急処置では、明示的な null 許容値の生成を削除します。
2026 年 6 月 12 日