Annotate Assert methods for better code analysis (#12618)

This commit is contained in:
Staffan Gustafsson
2020-05-11 11:57:31 -07:00
committed by GitHub
parent 440e02e367
commit b003b56e7b
@@ -11,6 +11,7 @@
#define DEBUG
using System.Diagnostics;
using System.Diagnostics.CodeAnalysis;
using System.Text;
namespace System.Management.Automation
@@ -126,6 +127,7 @@ namespace System.Management.Automation
#if RESHARPER_ATTRIBUTES
[JetBrains.Annotations.AssertionCondition(JetBrains.Annotations.AssertionConditionType.IS_TRUE)]
#endif
[DoesNotReturnIf(false)]
bool condition,
string whyThisShouldNeverHappen)
{
@@ -159,6 +161,7 @@ namespace System.Management.Automation
#if RESHARPER_ATTRIBUTES
[JetBrains.Annotations.AssertionCondition(JetBrains.Annotations.AssertionConditionType.IS_TRUE)]
#endif
[DoesNotReturnIf(false)]
bool condition,
string whyThisShouldNeverHappen, string detailMessage)
{