Skip to content

Commit

Permalink
ClassCastException when ctrl+hover over a 'case' literal
Browse files Browse the repository at this point in the history
Fixes #1764
  • Loading branch information
noopur2507 committed Nov 7, 2024
1 parent 6755dba commit f8220bf
Showing 1 changed file with 8 additions and 3 deletions.
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*******************************************************************************
* Copyright (c) 2000, 2023 IBM Corporation and others.
* Copyright (c) 2000, 2024 IBM Corporation and others.
*
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
Expand Down Expand Up @@ -2017,8 +2017,13 @@ public boolean visit(TypeParameter node) {

@Override
public boolean visit(TypePattern node) {
if (ASTHelper.isPatternSupported(node.getAST())) {
node.getPatternVariable().accept(this);
AST ast= node.getAST();
if (ASTHelper.isPatternSupported(ast)) {
if (ast.apiLevel() >= ASTHelper.JLS22) {
node.getPatternVariable2().accept(this);
} else {
node.getPatternVariable().accept(this);
}
}
return false;
}
Expand Down

0 comments on commit f8220bf

Please sign in to comment.