Skip to content
This repository has been archived by the owner on Mar 25, 2021. It is now read-only.

FR: Check that cases aren't duplicated in switch statement #2916

Closed
erikvullings opened this issue Jun 11, 2017 · 1 comment
Closed

FR: Check that cases aren't duplicated in switch statement #2916

erikvullings opened this issue Jun 11, 2017 · 1 comment

Comments

@erikvullings
Copy link

When creating a new case in a switch statement, it may happen that I duplicate an existing case. Wouldn't it be nice if this would generate an error (or at least a warning)

const a = create();
switch (a) {
  case 1:
     ...
     break;
  case 2:
     ...
     break;
  case 1:  // THIS SHOULD GENERATE AN ERROR
     ...
     break;
  default:
     ...
     break;
@JoshuaKGoldberg
Copy link
Contributor

Oh, this was fixed by #2937! 🎉

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants