Skip to content

Commit f61e8b5

Browse files
committed
Use Java instanceof pattern matching in InParseNode
1 parent 5d52e0b commit f61e8b5

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

src/main/java/org/truffleruby/parser/ast/InParseNode.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,8 +58,7 @@ public InParseNode(
5858
ParseNode nextCase) {
5959
super(position);
6060

61-
if (expressionNodes instanceof ArrayParseNode) {
62-
var arrayParseNode = (ArrayParseNode) expressionNodes;
61+
if (expressionNodes instanceof ArrayParseNode arrayParseNode) {
6362
if (arrayParseNode.size() != 1) {
6463
throw CompilerDirectives.shouldNotReachHere();
6564
}

0 commit comments

Comments
 (0)