You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

37 lines
933 B

  1. #if !NETCORE
  2. #nullable enable
  3. namespace System.Diagnostics.CodeAnalysis
  4. {
  5. [AttributeUsage(AttributeTargets.Property | AttributeTargets.Parameter | AttributeTargets.ReturnValue, AllowMultiple = true)]
  6. internal sealed class NotNullIfNotNullAttribute : Attribute
  7. {
  8. public string ParameterName { get; }
  9. public NotNullIfNotNullAttribute(string parameterName)
  10. {
  11. ParameterName = parameterName;
  12. }
  13. }
  14. [AttributeUsage(AttributeTargets.Parameter, Inherited = false)]
  15. internal sealed class NotNullWhenAttribute : Attribute
  16. {
  17. public NotNullWhenAttribute(bool returnValue)
  18. {
  19. ReturnValue = returnValue;
  20. }
  21. public bool ReturnValue { get; }
  22. }
  23. [AttributeUsage(AttributeTargets.Parameter, Inherited = false)]
  24. internal sealed class DoesNotReturnIfAttribute : Attribute
  25. {
  26. public DoesNotReturnIfAttribute(bool parameterValue) => ParameterValue = parameterValue;
  27. public bool ParameterValue { get; }
  28. }
  29. }
  30. #endif