You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: standard/attributes.md
+14-14Lines changed: 14 additions & 14 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -467,7 +467,7 @@ The compilation of an *attribute* with attribute class `T`, *positional_argumen
467
467
- Let `Name` be the *identifier* of the *named_argument* `Arg`.
468
468
- `Name` shall identify a non-static read-write public field or property on `T`. If `T` has no such field or property, then a compile-time error occurs.
469
469
- If any of the values within *positional_argument_list* `P` or one of the values within *named_argument_list* `N` is of type `System.String` and the value is not well-formed as defined by the Unicode Standard, it is implementation-defined whether the value compiled is equal to the run-time value retrieved ([§23.4.3](attributes.md#2343-run-time-retrieval-of-an-attribute-instance)).
470
-
> *Note*: As an example, a string which contains a high surrogate UTF-16 code unit which isn’t immediately followed by a low surrogate code unit is not well-formed. *end note*
470
+
> *Note*: As an example, a string which contains a high surrogate UTF-16 code unit which is not immediately followed by a low surrogate code unit is not well-formed. *end note*
471
471
- Store the following information (for run-time instantiation of the attribute) in the assembly output by the compiler as a result of compiling the program containing the attribute: the attribute class `T`, the instance constructor `C` on `T`, the *positional_argument_list* `P`, the *named_argument_list* `N`, and the associated program entity `E`, with the values resolved completely at compile-time.
472
472
473
473
### 23.4.3 Run-time retrieval of an attribute instance
@@ -840,7 +840,7 @@ For invocations that occur within declarations of instance constructors, static
840
840
841
841
#### 23.5.7.1 General
842
842
843
-
The attributes in this subclause are used to provide additional information to support a compiler that provides nullability and null-state diagnostics ([§8.9.5](types.md#895-nullabilities-and-null-states)). A compiler isn’t required to perform any null-state diagnostics. The presence or absence of these attributes do not affect the language nor the behavior of a program. A compiler that doesn’t provide null-state diagnostics shall read and ignore the presence of these attributes. A compiler that provides null-state diagnostics shall use the meaning defined in this subclause for any of these attributes which it uses to inform its diagnostics.
843
+
The attributes in this subclause are used to provide additional information to support a compiler that provides nullability and null-state diagnostics ([§8.9.5](types.md#895-nullabilities-and-null-states)). A compiler is not required to perform any null-state diagnostics. The presence or absence of these attributes do not affect the language nor the behavior of a program. A compiler that does not provide null-state diagnostics shall read and ignore the presence of these attributes. A compiler that provides null-state diagnostics shall use the meaning defined in this subclause for any of these attributes which it uses to inform its diagnostics.
844
844
845
845
The code-analysis attributes are declared in namespace `System.Diagnostics.CodeAnalysis`.
846
846
@@ -851,8 +851,8 @@ The code-analysis attributes are declared in namespace `System.Diagnostics.CodeA
851
851
`MaybeNull` ([§23.5.7.6](attributes.md#23576-the-maybenull-attribute)) | A non-nullable return value may be null.
852
852
`NotNull` ([§23.5.7.8](attributes.md#23578-the-notnull-attribute)) | A nullable return value will never be null.
853
853
`MaybeNullWhen` ([§23.5.7.7](attributes.md#23577-the-maybenullwhen-attribute)) | A non-nullable argument may be null when the method returns the specified `bool` value.
854
-
`NotNullWhen` ([§23.5.7.10](attributes.md#235710-the-notnullwhen-attribute)) | A nullable argument won’t be null when the method returns the specified `bool` value.
855
-
`NotNullIfNotNull` ([§23.5.7.9](attributes.md#23579-the-notnullifnotnull-attribute)) | A return value isn’t null if the argument for the specified parameter isn’t null.
854
+
`NotNullWhen` ([§23.5.7.10](attributes.md#235710-the-notnullwhen-attribute)) | A nullable argument will not be null when the method returns the specified `bool` value.
855
+
`NotNullIfNotNull` ([§23.5.7.9](attributes.md#23579-the-notnullifnotnull-attribute)) | A return value is not null if the argument for the specified parameter is not null.
856
856
`DoesNotReturn` ([§23.5.7.4](attributes.md#23574-the-doesnotreturn-attribute)) | This method never returns.
857
857
`DoesNotReturnIf` ([§23.5.7.5](attributes.md#23575-the-doesnotreturnif-attribute)) | This method never returns if the associated `bool` parameter has the specified value.
858
858
@@ -911,7 +911,7 @@ Specifies that a null value is disallowed as an input even if the corresponding
Membersofatypeareeitherdeclaredinthetypedeclarationor***inherited***fromthebaseclassof the type. When a type inherits from a base class, all members of the base class, except instance constructors, finalizers, and static constructors become members of the derived type. The declared accessibility of a base class member does not control whether the member is inherited—inheritance extends to any member that isn’t an instance constructor, static constructor, or finalizer.
212
+
Membersofatypeareeitherdeclaredinthetypedeclarationor***inherited***fromthebaseclassof the type. When a type inherits from a base class, all members of the base class, except instance constructors, finalizers, and static constructors become members of the derived type. The declared accessibility of a base class member does not control whether the member is inherited—inheritance extends to any member that is not an instance constructor, static constructor, or finalizer.
213
213
214
214
> *Note*: However, aninheritedmembermightnotbeaccessibleinaderivedtype, forexamplebecauseofitsdeclaredaccessibility ([§7.5.2](basic-concepts.md#752-declared-accessibility)). *endnote*
215
215
@@ -806,7 +806,7 @@ Contrary to hiding a name from an outer scope, hiding a visible name from an inh
0 commit comments