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
* format *end note*
The *end note* marker for a note should be at the end of a single paragraph note. If a note spans multiple paragraphs (including notes that contain examples or lists), the *end note* marker should be its own paragraph.
* Format *end example*
The *end example* marker for a note should be at the end of a single paragraph note. If a note spans multiple paragraphs (including notes that contain examples or lists), the *end example* marker should be its own paragraph.
* fix lint warnings.
* fix markdown converter issues
One example and one note had their final paragraph not included in the block quote.
* add link to comment on code change
This code change may be wrong. See comment.
>Here, theinitializerfor `y` results in a compile-time error because the dimension length expression is not a constant, and the initializer for `z` results in a compile-time error because the length and the number of elements in the initializer do not agree. *end example*
255
+
>Here, theinitializerfor `y` results in a compile-time error because the dimension length expression is not a constant, and the initializer for `z` results in a compile-time error because the length and the number of elements in the initializer do not agree.
Copy file name to clipboardExpand all lines: standard/attributes.md
+32-11Lines changed: 32 additions & 11 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -94,7 +94,9 @@ The attribute `AttributeUsage` ([§21.5.2](attributes.md#2152-the-attributeusage
94
94
> }
95
95
> ```
96
96
>
97
-
>showsaclassdeclaration with two uses of the `Author` attribute. *end example*
97
+
>showsaclassdeclaration with two uses of the `Author` attribute.
98
+
>
99
+
> *end example*
98
100
99
101
`AttributeUsage` has another named parameter ([§21.2.3](attributes.md#2123-positional-and-named-parameters)), called `Inherited`, which indicates whether the attribute, when specified on a base class, is also inherited by classes that derive from that base class. If `Inherited` for an attribute class is true, then that attribute is inherited. If `Inherited` for an attribute class is false then that attribute is not inherited. If it is unspecified, its default value is true.
100
102
@@ -318,7 +320,7 @@ In all other contexts, inclusion of an *attribute_target_specifier* is permitted
@@ -699,7 +709,9 @@ The use of conditional methods in an inheritance chain can be confusing. Calls m
699
709
> }
700
710
> ```
701
711
>
702
-
> `Class2` includesacalltothe `M` definedinitsbase class. This call is omitted because the base method is conditional based on the presence of the symbol `DEBUG`, which is undefined. Thus, the method writes to the console “`Class2.M executed`” only. Judicious use of *pp_declaration*s can eliminate such problems. *end example*
712
+
> `Class2` includesacalltothe `M` definedinitsbase class. This call is omitted because the base method is conditional based on the presence of the symbol `DEBUG`, which is undefined. Thus, the method writes to the console “`Class2.M executed`” only. Judicious use of *pp_declaration*s can eliminate such problems.
713
+
>
714
+
> *end example*
703
715
704
716
#### 21.5.3.3 Conditional attribute classes
705
717
@@ -716,7 +728,9 @@ An attribute class ([§21.2](attributes.md#212-attribute-classes)) decorated wit
716
728
>publicclassTestAttribute : Attribute {}
717
729
> ```
718
730
>
719
-
>declares `TestAttribute` asaconditionalattributeclassassociated with the conditional compilations symbols `ALPHA` and `BETA`. *end example*
731
+
>declares `TestAttribute` asaconditionalattributeclassassociated with the conditional compilations symbols `ALPHA` and `BETA`.
732
+
>
733
+
> *end example*
720
734
721
735
Attribute specifications ([§21.3](attributes.md#213-attribute-specification)) of a conditional attribute are included if one or more of its associated conditional compilation symbols is defined at the point of specification, otherwise the attribute specification is omitted.
722
736
@@ -743,7 +757,9 @@ It is important to note that the inclusion or exclusion of an attribute specific
@@ -775,7 +791,9 @@ If a program uses a type or member that is decorated with the `Obsolete` attribu
775
791
> }
776
792
> ```
777
793
>
778
-
>the class `A` is decorated with the `Obsolete` attribute. Each use of `A` in `Main` results in a warning that includes the specified message, “This classis obsolete; use class `B` instead”. *end example*
794
+
>the class `A` is decorated with the `Obsolete` attribute. Each use of `A` in `Main` results in a warning that includes the specified message, “This classis obsolete; use class `B` instead”.
795
+
>
796
+
> *end example*
779
797
780
798
### 21.5.5 Caller-info attributes
781
799
@@ -804,7 +822,9 @@ When an optional parameter is annotated with one of the caller-info attributes,
804
822
> }
805
823
> ```
806
824
>
807
-
> A call to `Log()` with no arguments would print the line number and file path of the call, as well as the name of the member within which the call occurred. *end example*
825
+
> A call to `Log()` with no arguments would print the line number and file path of the call, as well as the name of the member within which the call occurred.
826
+
>
827
+
> *end example*
808
828
809
829
Caller-info attributes can occur on optional parameters anywhere, including in delegate declarations. However, the specific caller-info attributes have restrictions on the types of the parameters they can attribute, so that there will always be an implicit conversion from a substituted value to the parameter type.
810
830
@@ -871,4 +891,5 @@ For interoperation with other languages, an indexer may be implemented using ind
0 commit comments