Tweak documentation on NotNullAttribute (#1891)
authorJulien Couvreur <jcouv@users.noreply.github.com>
Sat, 18 Jan 2020 01:12:01 +0000 (17:12 -0800)
committerStephen Toub <stoub@microsoft.com>
Sat, 18 Jan 2020 01:12:01 +0000 (20:12 -0500)
Tagging @BillWagner @stephentoub @RikkiGibson

The use of `[NotNull]` on an input parameter is allowed. The typical example is an `AssertNotNull` method. That behavior was [specified](https://github.com/dotnet/csharplang/blob/master/meetings/2019/LDM-2019-05-15.md#simple-postconditions), but does not appear in the docs. Adding a mention.

I assume that changes here propagate to docs automatically.

src/libraries/System.Private.CoreLib/src/System/Diagnostics/CodeAnalysis/NullableAttributes.cs

index 3770a5ff0ba2b2a0cd0deea0b7deb4754347c1d6..0b24c01a76438e1234692acc3ccdaa5895c1d633 100644 (file)
@@ -31,7 +31,7 @@ namespace System.Diagnostics.CodeAnalysis
 #endif
         sealed class MaybeNullAttribute : Attribute { }
 
-    /// <summary>Specifies that an output will not be null even if the corresponding type allows it.</summary>
+    /// <summary>Specifies that an output will not be null even if the corresponding type allows it. Specifies that an input argument was not null when the call returns.</summary>
     [AttributeUsage(AttributeTargets.Field | AttributeTargets.Parameter | AttributeTargets.Property | AttributeTargets.ReturnValue, Inherited = false)]
 #if INTERNAL_NULLABLE_ATTRIBUTES
     internal