Skip to content

Control falls through switch statement case labels #168

@tenor

Description

@tenor

This issue was previously reported in the old Roslyn forums.

var i = 0;

switch (i)
{
    case 0:
        Console.WriteLine('0');
    case 1:
        Console.WriteLine('1');
    case 2:
        break;
}

The code above will compile in both scripting and interactive mode.

In interactive mode, the code will compile even if the break statement is omitted.

Edited Code for clarity

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions