Skip to content

Indent comment under final default in switch #1209

Open
@stereotype441

Description

@stereotype441

Formatting the following code:

void f(int i) {
  switch (i) {
    case 0:
      print('zero');
    case 1:
      print('one');
    default:
      // Don't print anything
  }
}

Produces this result:

void f(int i) {
  switch (i) {
    case 0:
      print('zero');
    case 1:
      print('one');
    default:
    // Don't print anything
  }
}

(Note that the comment // Don't print anything was shifted to the left).

IMHO the comment should be indented relative to default:, just like code would have been.

Reproduced as of 6c9bc10.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions