Skip to content

Update documentation on switch to explain the fallthrough enum case better - #333

Open
regier21 wants to merge 1 commit into
odin-lang:masterfrom
regier21:rjr2302-update-enum-documentation
Open

Update documentation on switch to explain the fallthrough enum case better#333
regier21 wants to merge 1 commit into
odin-lang:masterfrom
regier21:rjr2302-update-enum-documentation

Conversation

@regier21

Copy link
Copy Markdown

I was confused about why an empty case was required in a switch statement that covers every enum member when returning from the switch. I even opened an issue to that effect in the main Odin repo, but I was told that this was intended behavior to account for enum variables possibly taking on invalid values. This is unusual compared to other languages I've used and I thought it might trip some other people up, so I added some clarifying info into the overview to explain this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant