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.

25 lines
725 B

  1. // Licensed to the .NET Foundation under one or more agreements.
  2. // The .NET Foundation licenses this file to you under the MIT license.
  3. namespace System.Diagnostics.CodeAnalysis
  4. {
  5. [AttributeUsage(AttributeTargets.Method | AttributeTargets.Property, Inherited = false, AllowMultiple = true)]
  6. internal sealed class MemberNotNullWhenAttribute : Attribute
  7. {
  8. public bool ReturnValue { get; }
  9. public string[] Members { get; }
  10. public MemberNotNullWhenAttribute(bool returnValue, string member)
  11. {
  12. ReturnValue = returnValue;
  13. Members = new string[1] { member };
  14. }
  15. public MemberNotNullWhenAttribute(bool returnValue, params string[] members)
  16. {
  17. ReturnValue = returnValue;
  18. Members = members;
  19. }
  20. }
  21. }