Skip to content

Commit

Permalink
fix preprocessor symbols and test messages
Browse files Browse the repository at this point in the history
  • Loading branch information
BillWagner committed May 31, 2024
1 parent 4fa2561 commit 53d837a
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions standard/types.md
Original file line number Diff line number Diff line change
Expand Up @@ -789,9 +789,10 @@ When the nullable context is annotations:
> *Example*:
>
> <!-- Example: {template:"code-in-main-without-using", name:"NullableAnnotationContext2", ignoredWarnings:["CS0219"], expectedWarnings:["CS8600","CS8600","CS8602"], expectedException:"NullReferenceException"} -->
> <!-- Example: {template:"code-in-main-without-using", name:"NullableAnnotationContext2", ignoredWarnings:["CS0219"], expectedException:"NullReferenceException"} -->
> ```csharp
> #nullable annotations
> #nullable disable warnings
> #nullable enable annotations
> string? s1 = null; // OK; ? makes s2 nullable
> string s2 = null; // OK; warnings are disabled
> s2 = null; // OK; warnings are disabled
Expand All @@ -816,9 +817,10 @@ Some warnings are generated when the nullable context is set to *warnings*. (Exa
> *Example*:
>
> <!-- Example: {template:"code-in-main-without-using", name:"NullableAnnotationContext3", ignoredWarnings:["CS0219"], expectedWarnings:["CS8600","CS8600","CS8602"], expectedException:"NullReferenceException"} -->
> <!-- Example: {template:"code-in-main-without-using", name:"NullableAnnotationContext3", ignoredWarnings:["CS0219"], expectedWarnings:["CS8632", "CS8602"], expectedException:"NullReferenceException"} -->
> ```csharp
> #nullable warnings
> #nullable disable annotations
> #nullable enable warnings
> string? s1 = null; // OK; ? makes s2 nullable
> string s2 = null; // OK; null-state of s2 is "maybe null"
> s2 = null; // OK; null-state of s2 is "maybe null"
Expand All @@ -843,9 +845,9 @@ When the nullable context is enable:
> *Example*:
>
> <!-- Example: {template:"code-in-main-without-using", name:"NullableAnnotationContext4", ignoredWarnings:["CS0219"], expectedWarnings:["CS8600","CS8600","CS8602"], expectedException:"NullReferenceException"} -->
> <!-- Example: {template:"code-in-main-without-using", name:"NullableAnnotationContext4", ignoredWarnings:["CS0219"], expectedWarnings:["CS8637"], expectedException:"NullReferenceException"} -->
> ```csharp
> #nullable warnings
> #nullable enable
> string? s1 = null; // OK; ? makes s2 nullable
> string s2 = "text"; // OK; null-state of s2 is "not null"
> s2 = null; // OK; null-state of s2 is "maybe null"
Expand Down

0 comments on commit 53d837a

Please sign in to comment.