18 lines
710 B
C#
Raw Normal View History

2021-09-20 18:20:01 +02:00
#if NETFRAMEWORK
namespace System.Diagnostics.CodeAnalysis {
[AttributeUsage(AttributeTargets.Parameter, Inherited = false)]
sealed class NotNullWhenAttribute : Attribute {
public NotNullWhenAttribute(bool returnValue) => ReturnValue = returnValue;
public bool ReturnValue { get; }
}
[AttributeUsage(AttributeTargets.Property | AttributeTargets.Field | AttributeTargets.Parameter, Inherited = false)]
sealed class AllowNullAttribute : Attribute {
public AllowNullAttribute() { }
}
[AttributeUsage(AttributeTargets.Property | AttributeTargets.Field | AttributeTargets.Parameter, Inherited = false)]
sealed class DisallowNullAttribute : Attribute {
public DisallowNullAttribute() { }
}
}
#endif