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
Fixesdotnet#937
I admit this rule confused me, and I asked to add the example.
After reading the updated, I'm ambivalent about adding the example. I don't want to move it into the bullet list, as that breaks the flow even more.
Let's discuss if it's needed at the meeting.
Copy file name to clipboardExpand all lines: standard/variables.md
+13Lines changed: 13 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -343,6 +343,19 @@ The definite-assignment state of *v* on the control flow transfer to a reachable
343
343
- If *v* is a pattern variable declared in the *switch_label*: “definitely assigned”.
344
344
- Otherwise, the state of *v* is the same as the stat of *v* after *expr*.
345
345
346
+
> *Example*: The third rule eliminates the need for the compiler to warn if an unassigned variable is accessed in unreachable code. The state of *b* is "definitely assigned" in the unreachable switch label `case 2 when b`.
0 commit comments