-
Notifications
You must be signed in to change notification settings - Fork 4.2k
Closed
Labels
Area-Language DesignFeature RequestLanguage-C#Resolution-Won't FixA real bug, but Triage feels that the issue is not impactful enough to spend time on.A real bug, but Triage feels that the issue is not impactful enough to spend time on.Verification Not Required
Description
The following proposal's value may be really low, nothing revolutionary, but sometimes one may need the code like the following:
// bar is an IEnumerable<T>
foreach ( var foo : bar ) {
Console.WriteLine(foo);
} else {
Console.WriteLine("no foos in the bar");
}
Just a little syntax sugar.
EDIT
Please note that there would be no a straightforward extension method: foreach might contain break, continue and return.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
Area-Language DesignFeature RequestLanguage-C#Resolution-Won't FixA real bug, but Triage feels that the issue is not impactful enough to spend time on.A real bug, but Triage feels that the issue is not impactful enough to spend time on.Verification Not Required