Skip to content

Commit

Permalink
Respond to initial feedback
Browse files Browse the repository at this point in the history
  • Loading branch information
BillWagner committed Oct 25, 2024
1 parent 4986099 commit 8eb1146
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions standard/types.md
Original file line number Diff line number Diff line change
Expand Up @@ -872,7 +872,7 @@ A diagnostic can be produced when a variable ([§9.2.1](variables.md#921-general
> {
> public void M(string? p)
> {
> // Assignment to maybe null
> // Assignment of maybe null value to non-nullable variable
> string s = p;
> }
> }
Expand All @@ -887,7 +887,11 @@ A diagnostic can be produced when a variable ([§9.2.1](variables.md#921-general
> {
> public void M(string? p)
> {
> string s = p ?? ""; // null check
> if (p is not null)
> {
> string s = p;
> // Use s
> }
> }
> }
> ```
Expand Down Expand Up @@ -922,7 +926,7 @@ The compiler can update the null state of a variable as part of its analysis.
<!-- markdownlint-disable MD028 -->
<!-- markdownlint-enable MD028 -->
> *Example*: The compiler can treat a property ([§15.7](classes.md#157-properties)) as either a variable with state, or as independent get and set accessors ([§15.7.3](classes.md#1573-accessors)). In other words, a compiler can choose if writing to a property changes the null state of reading the property, or if reading a property changes the null state of that property.
> *Example*: The compiler can treat a property ([§15.7](classes.md#157-properties)) as either a variable with state, or as independent get and set accessors ([§15.7.3](classes.md#1573-accessors)). In other words, a compiler can choose whether writing to a property changes the null state of reading the property, or if reading a property changes the null state of that property.
>
> <!-- Example: {template:"standalone-console", name:"NullPropertyAnalysis"} -->
> ```csharp
Expand Down

0 comments on commit 8eb1146

Please sign in to comment.