Skip to content

Flow should recognize and complain about duplicated case statements #3601

@SheetJSDev

Description

@SheetJSDev

This is currently accepted but really should be an error (at least, closure compiler recognizes the error):

function foo(x: ?number): string {
  switch(x) {
    case 2: return "foo";
    case 3: return "bar";
    case 3: return "baz";
  }
  return "default string";
}

Metadata

Metadata

Assignees

No one assigned

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions