Skip to content

Commit 146856d

Browse files
committed
[Truffle] Fix load of default arguments that are arrays.
1 parent 96f075a commit 146856d

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

truffle/src/main/java/org/jruby/truffle/translator/LoadArgumentsTranslator.java

+5-1
Original file line numberDiff line numberDiff line change
@@ -318,7 +318,11 @@ private RubyNode translateLocalAssignment(ISourcePosition sourcePosition, String
318318
@Override
319319
public RubyNode visitArrayNode(org.jruby.ast.ArrayNode node) {
320320
// (ArrayNode 0, (MultipleAsgn19Node 0, (ArrayNode 0, (LocalAsgnNode:a 0, ), (LocalAsgnNode:b 0, )), null, null)))
321-
return node.childNodes().get(0).accept(this);
321+
if (node.size() == 1 && node.get(0) instanceof org.jruby.ast.MultipleAsgn19Node) {
322+
return node.childNodes().get(0).accept(this);
323+
} else {
324+
return defaultVisit(node);
325+
}
322326
}
323327

324328
@Override

0 commit comments

Comments
 (0)