2022-08-05 23:18:42 +00:00
|
|
|
#if !NET6_0_OR_GREATER
|
2022-07-07 00:30:14 +00:00
|
|
|
namespace System.Diagnostics.CodeAnalysis;
|
|
|
|
|
|
|
|
[AttributeUsage(AttributeTargets.Parameter)]
|
|
|
|
internal sealed class NotNullWhenAttribute : Attribute
|
|
|
|
{
|
|
|
|
/// <summary>Initializes the attribute with the specified return value condition.</summary>
|
|
|
|
/// <param name="returnValue">
|
|
|
|
/// The return value condition. If the method returns this value, the associated parameter will not be null.
|
|
|
|
/// </param>
|
|
|
|
public NotNullWhenAttribute(bool returnValue) => ReturnValue = returnValue;
|
|
|
|
|
|
|
|
/// <summary>Gets the return value condition.</summary>
|
|
|
|
public bool ReturnValue { get; }
|
|
|
|
}
|
|
|
|
#endif
|