Skip to content

Commit

Permalink
Skip parens
Browse files Browse the repository at this point in the history
  • Loading branch information
smillst authored Oct 11, 2024
1 parent b4e97b9 commit 6e8ed8e
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
7 changes: 7 additions & 0 deletions framework/tests/all-systems/Issue6856.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
import java.util.Collections;

public class Issue6856 {
static void test(Class<String> p) {
var x = Collections.checkedCollection((Collections.emptyList()), p);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -2849,6 +2849,7 @@ public static boolean isPolyExpression(ExpressionTree expression) {
* @return whether or not {@code expression} is a standalone expression
*/
public static boolean isStandaloneExpression(ExpressionTree expression) {
expression = TreeUtils.withoutParens(expression);
if (expression instanceof JCTree.JCExpression) {
if (((JCTree.JCExpression) expression).isStandalone()) {
return true;
Expand Down

0 comments on commit 6e8ed8e

Please sign in to comment.