Skip to content

Commit

Permalink
remove conditional checks that are now obsolete
Browse files Browse the repository at this point in the history
  • Loading branch information
stephan-herrmann committed Oct 23, 2024
1 parent 7e73c2b commit 7d2f381
Showing 1 changed file with 0 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -382,12 +382,6 @@ private Constant resolveCasePattern(BlockScope scope, TypeBinding caseType, Type
if (!e.isApplicable(switchExpressionType, scope, e)) {
return Constant.NotAConstant;
}
if (expressionType != TypeBinding.NULL && !(e instanceof RecordPattern)) {
boolean isLegal = e.checkCastTypesCompatibility(scope, type, expressionType, e, false);
if (!isLegal || (e.bits & ASTNode.UnsafeCast) != 0) {
scope.problemReporter().unsafeCastInTestingContext(e, type, expressionType);
}
}
} else if (type.isValidBinding()) {
// if not a valid binding, an error has already been reported for unresolved type
if (Pattern.findPrimitiveConversionRoute(type, expressionType, scope) == PrimitiveConversionRoute.NO_CONVERSION_ROUTE) {
Expand Down

0 comments on commit 7d2f381

Please sign in to comment.