Skip to content

Commit

Permalink
Remove unreachable default cases from switch expressions on enums
Browse files Browse the repository at this point in the history
New `->`-style switch expressions on enums have built-in handling of exhaustiveness, if a default is omitted the switch will implicitly throw a `MatchException` if the switch has an impossible value.

PiperOrigin-RevId: 713785508
Change-Id: I57614847231568d213c02b0f91b5cb181542ad59
  • Loading branch information
cushon authored and copybara-github committed Jan 9, 2025
1 parent e78bab5 commit 9b36f96
Showing 1 changed file with 0 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -664,7 +664,6 @@ private Artifact internalCreateOutputArtifact(
return switch (outputFileKind) {
case FILE -> getDerivedArtifact(rootRelativePath, root);
case FILESET -> getAnalysisEnvironment().getFilesetArtifact(rootRelativePath, root);
default -> throw new IllegalStateException();
};
}

Expand Down

0 comments on commit 9b36f96

Please sign in to comment.