C#


ROSLYN.RELIABILITY.CA2020 : Prevent behavioral change (C#)

See Roslyn-Detected C# Warning Classes for more information.

要旨

Some built-in operators added in .NET 7 behave differently when overflowing than did the corresponding user-defined operators in .NET 6 and earlier versions. Some operators that previously threw in an unchecked context now don't throw unless wrapped within a checked context. Also, some operators that did not previously throw in a checked context now throw unless wrapped in an unchecked context.

この指摘はRoslynのCA2020に該当します。ルール詳細につい ては、下記リンクを参照してください。 CA2020

プロパティ

クラス名 Prevent behavioral change (C#)
日本語クラス名 Prevent behavioral change (C#)
クラス分類 信頼性 (reliability)
ニーモニック ROSLYN.RELIABILITY.CA2020
カテゴリー なし
対応言語 C# で利用可能です。
有効/無効設定 このワーニングクラスのチェックはデフォルトで有効になっています。チェックを無効にするにはプロジェクト設定ファイル (configuration file)に以下の WARNING_FILTER ルールを追加してください。
WARNING_FILTER += discard class="Prevent behavioral change (C#)"

関連のある設定ファイルパラメータ

設定ファイルの以下のパラメータがこのワーニングクラスのチェックに影響します。