Skip to content

Add example for definite assignment due to unreachable switch label #937

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
BillWagner opened this issue Sep 15, 2023 · 0 comments · Fixed by #1012
Closed

Add example for definite assignment due to unreachable switch label #937

BillWagner opened this issue Sep 15, 2023 · 0 comments · Fixed by #1012
Assignees
Labels
type: clarity While not technically incorrect, the Standard is potentially confusing
Milestone

Comments

@BillWagner
Copy link
Member

BillWagner commented Sep 15, 2023

See #757 (comment)

In 9.4.4.7 we have:

  • If the control transfer was due to an unreachable switch label, then the state of v is "definitely assigned".

An example would make this rule more clear. But, it would break the flow of the text, and it is an uncommon case.

Deferred to discuss post 7.3


Associated WorkItem - 178984

@jskeet jskeet added this to the C# 8.0 milestone Sep 20, 2023
@jskeet jskeet added the type: clarity While not technically incorrect, the Standard is potentially confusing label Sep 20, 2023
@jskeet jskeet modified the milestones: C# 8.0, Pre-C# 8.0 Sep 21, 2023
@BillWagner BillWagner self-assigned this Oct 23, 2023
@BillWagner BillWagner moved this from 🔖 Ready to 🏗 In progress in dotnet/docs November 2023 sprint Nov 24, 2023
BillWagner added a commit to BillWagner/csharpstandard that referenced this issue Nov 24, 2023
Fixes dotnet#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.
@BillWagner BillWagner moved this from 🏗 In progress to 👀 In review in dotnet/docs November 2023 sprint Nov 24, 2023
jskeet pushed a commit that referenced this issue Nov 29, 2023
Fixes #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.
@github-project-automation github-project-automation bot moved this from 👀 In review to ✅ Done in dotnet/docs November 2023 sprint Nov 29, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: clarity While not technically incorrect, the Standard is potentially confusing
Projects
No open projects
Status: ✅ Done
Development

Successfully merging a pull request may close this issue.

2 participants