Replies: 1 comment 1 reply
-
|
With regards to "Labeled break and continue Statements", the primary use case for me would actually be being able to loop: foreach (var item in items)
{
switch (item)
{
case TypeA a:
// Something with a
break;
case TypeB b:
// Something with b
break;
case TypeC c:
// I want to break out of the foreach here, not the switch
break loop;
}
}If this is supported by the proposal for labeled break and continue statements, that would be the bigger win for me as I run into this scenario quite often, certainly more often than nested loops. Maybe it can be added to the proposal document? |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
https://github.com/dotnet/csharplang/blob/main/meetings/2026/LDM-2026-01-12.md
Agenda
partialandrefmodifiersbreakandcontinueStatementsBeta Was this translation helpful? Give feedback.
All reactions