Skip to content

Commit 61e0c79

Browse files
committed
Fix issues caught by checks
1 parent 95a4f4e commit 61e0c79

File tree

1 file changed

+11
-9
lines changed

1 file changed

+11
-9
lines changed

standard/types.md

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -859,7 +859,7 @@ A compiler is not required to perform any static analysis nor is it required to
859859
860860
**The remainder of this subclause is conditionally normative.**
861861
862-
#### 8.9.5.1 Flow analysis
862+
#### §flow-analysis Flow analysis
863863
864864
A compiler that generates diagnostic warnings conforms to these rules.
865865
@@ -1044,7 +1044,7 @@ A compiler may use any expression that dereferences a variable, property, or eve
10441044
>
10451045
> *end example*
10461046
1047-
#### 8.9.5.2 Type conversions
1047+
#### §type-conversions Type conversions
10481048
10491049
A compiler that generates diagnostic warnings conforms to these rules.
10501050
@@ -1054,7 +1054,7 @@ A compiler may issue a warning when nullability annotations differ between two t
10541054
10551055
> *Example*: Types differing in top-level annotations
10561056
>
1057-
> <!-- Example: {template:"code-in-class-lib", name:"TopLevelNullabilityConversionWarnings"} -->
1057+
> <!-- Example: {template:"code-in-class-lib", name:"TopLevelNullabilityConversionWarnings", ignoredWarnings:["CS8600"]} -->
10581058
> ```csharp
10591059
> #nullable enable
10601060
> public class C
@@ -1073,10 +1073,12 @@ A compiler may issue a warning when nullability annotations differ between two t
10731073
> ```
10741074
>
10751075
> *end example*
1076+
<!-- markdownlint-disable MD028 -->
10761077
1078+
<!-- markdownlint-enable MD028 -->
10771079
> *Example*: Types differing in nested nullability annotations
10781080
>
1079-
> <!-- Example: {template:"code-in-class-lib", name:"NestedNullabilityConversionWarnings"} -->
1081+
> <!-- Example: {template:"code-in-class-lib", name:"NestedNullabilityConversionWarnings", ignoredWarnings:["CS8619"]} -->
10801082
> ```csharp
10811083
> #nullable enable
10821084
> public class C
@@ -1096,9 +1098,9 @@ A compiler may issue a warning when nullability annotations differ between two t
10961098
>
10971099
> *end example*
10981100
1099-
A compiler may follow rules for interface variance ([§18.2.3.3](interfaces.md#18233-variance-conversion)), delegate variance ([§20.4](delegates.md#204-delegate-compatibility)), and array covariance (1.7.6](arrays.md#176-array-covariance)) in determining whether to issue a warning for type conversions.
1101+
A compiler may follow rules for interface variance ([§18.2.3.3](interfaces.md#18233-variance-conversion)), delegate variance ([§20.4](delegates.md#204-delegate-compatibility)), and array covariance (§17.6) in determining whether to issue a warning for type conversions.
11001102
1101-
> <!-- Example: {template:"code-in-class-lib", name:"NullVariance"} -->
1103+
> <!-- Example: {template:"code-in-class-lib", name:"NullVariance", ignoredWarnings:["CS8619"]} -->
11021104
> ```csharp
11031105
> #nullable enable
11041106
> public class C
@@ -1142,21 +1144,21 @@ A compiler may follow rules for interface variance ([§18.2.3.3](interfaces.md#1
11421144
11431145
A compiler may issue a warning when nullability differs in either direction in types which do not permit a variant conversion.
11441146
1145-
> <!-- Example: {template:"code-in-class-lib", name:"NullInvariance"} -->
1147+
> <!-- Example: {template:"code-in-class-lib", name:"NullInvariance", ignoredWarnings:["CS8619"]} -->
11461148
> ```csharp
11471149
> #nullable enable
11481150
> public class C
11491151
> {
11501152
> public void M1(List<string> p)
11511153
> {
11521154
> List<string?> v1 = p; // Warning
1153-
> List<string?> v1 = p!; // No warning
1155+
> List<string?> v2 = p!; // No warning
11541156
> }
11551157
>
11561158
> public void M2(List<string?> p)
11571159
> {
11581160
> List<string> v1 = p; // Warning
1159-
> List<string> v1 = p!; // No warning
1161+
> List<string> v2 = p!; // No warning
11601162
> }
11611163
> }
11621164
> ```

0 commit comments

Comments
 (0)