Skip to content

Commit

Permalink
Accept 'case Throwable _'
Browse files Browse the repository at this point in the history
  • Loading branch information
lahodaj committed Dec 15, 2023
1 parent ee1e4b6 commit 786805f
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -1827,7 +1827,8 @@ private void handleSwitch(JCTree switchTree,
unguarded &&
!patternType.isErroneous() &&
types.isSubtype(types.boxedTypeOrType(types.erasure(expectedType)),
patternType);
patternType) &&
!c.throwsCase; //TODO: there should be two distinct "unconditional" checks, one for "normal" cases, one for "exceptional" cases
if (unconditional) {
if (hasUnconditionalPattern) {
log.error(pat.pos(), Errors.DuplicateUnconditionalPattern);
Expand Down

0 comments on commit 786805f

Please sign in to comment.