Skip to content
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

[Proposal]: Block-bodied switch expression arms #8610

Open
333fred opened this issue Nov 18, 2024 · 0 comments
Open

[Proposal]: Block-bodied switch expression arms #8610

333fred opened this issue Nov 18, 2024 · 0 comments
Assignees
Milestone

Comments

@333fred
Copy link
Member

333fred commented Nov 18, 2024

Block-bodied switch expression arms

Summary

This proposal is an enhancement to the new switch expressions added in C# 8.0: allowing multiple statements in a switch expression arm. We permit braces after the arrow, and use break value; to return a value from the switch expression arm.

Design meetings

https://github.com/dotnet/csharplang/blob/main/meetings/2022/LDM-2022-09-26.md#discriminated-unions
https://github.com/dotnet/csharplang/blob/main/meetings/2024/LDM-2024-08-28.md#block-bodied-switch-expression-arms

@333fred 333fred added this to the Working Set milestone Nov 18, 2024
@333fred 333fred self-assigned this Nov 18, 2024
@dotnet dotnet locked and limited conversation to collaborators Nov 18, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

1 participant