Skip to content

[C# 15-Fundamentals and reference]: Labeled break and continue #54653

Description

@BillWagner

.NET 11 Preview

.NET 11 Preview 7

Link to speclet

Link to Pull request

New behavior

Allows break and continue to optionally specify a label that identifies which loop or switch statement to target.

outer: for (...)
{
    for (...)
    {
        break outer;
    }
}

In reference, this impacts all looping constructs, and switch statements will need the behavior clarified for the new feature.

Language reference tasks

No response

Everyday C# tasks

No response


Associated WorkItem - 595283

Metadata

Metadata

Assignees

Type

No type

Fields

No fields configured for issues without a type.

Projects

Status
🔖 Ready

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions