/// <summary>Gets the condition parameter value.</summary>
public bool ParameterValue { get; }
}
+
+ /// <summary>Specifies that the method or property will ensure that the listed field and property members have not-null values.</summary>
+ [AttributeUsage(AttributeTargets.Method | AttributeTargets.Property, Inherited = false)]
+#if INTERNAL_NULLABLE_ATTRIBUTES
+ internal
+#else
+ [CLSCompliant(false)]
+ public
+#endif
+ sealed class MemberNotNullAttribute : Attribute
+ {
+ /// <summary>Initializes the attribute with the list of field and property members.</summary>
+ /// <param name="members">
+ /// The list of field and property members that are promised to be not-null.
+ /// </param>
+ public MemberNotNullAttribute(params string[] members)
+ => Members = members;
+
+ /// <summary>Gets field or property member names.</summary>
+ public string[] Members { get; }
+ }
+
+ /// <summary>Specifies that the method or property will ensure that the listed field and property members have not-null values when returning with the specified return value condition.</summary>
+ [AttributeUsage(AttributeTargets.Method | AttributeTargets.Property, Inherited = false)]
+#if INTERNAL_NULLABLE_ATTRIBUTES
+ internal
+#else
+ [CLSCompliant(false)]
+ public
+#endif
+ sealed class MemberNotNullWhenAttribute : Attribute
+ {
+ /// <summary>Initializes the attribute with the specified return value condition and list of field and property members.</summary>
+ /// <param name="returnValue">
+ /// The return value condition. If the method returns this value, the associated parameter will not be null.
+ /// </param>
+ /// <param name="members">
+ /// The list of field and property members that are promised to be not-null.
+ /// </param>
+ public MemberNotNullWhenAttribute(bool returnValue, params string[] members)
+ {
+ ReturnValue = returnValue;
+ Members = members;
+ }
+
+ /// <summary>Gets the return value condition.</summary>
+ public bool ReturnValue { get; }
+
+ /// <summary>Gets field or property member names.</summary>
+ public string[] Members { get; }
+ }
}
public NotNullWhenAttribute(bool returnValue) { }
public bool ReturnValue { get { throw null; } }
}
+ [System.AttributeUsage(System.AttributeTargets.Method | System.AttributeTargets.Property, Inherited = false)]
+ [System.CLSCompliant(false)]
+ public sealed class MemberNotNullAttribute : System.Attribute
+ {
+ public MemberNotNullAttribute(params string[] members) { }
+ public string[] Members { get { throw null; } }
+ }
+ [System.AttributeUsage(System.AttributeTargets.Method | System.AttributeTargets.Property, Inherited = false)]
+ [System.CLSCompliant(false)]
+ public sealed class MemberNotNullWhenAttribute : System.Attribute
+ {
+ public MemberNotNullWhenAttribute(bool returnValue, params string[] members) { }
+ public bool ReturnValue { get { throw null; } }
+ public string[] Members { get { throw null; } }
+ }
[System.AttributeUsageAttribute(System.AttributeTargets.All, Inherited=false, AllowMultiple=true)]
[System.Diagnostics.ConditionalAttribute("CODE_ANALYSIS")]
public sealed partial class SuppressMessageAttribute : System.Attribute