Skip to content

Commit 9b6f02f

Browse files
eregonandrykonchin
authored andcommitted
Ignore node wrappers in RubyCallNode#getLastArgumentNode()
1 parent 7ae0112 commit 9b6f02f

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/main/java/org/truffleruby/language/dispatch/RubyCallNode.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -283,7 +283,7 @@ private RubyNode getLastArgumentNode() {
283283

284284
// BodyTranslator-specific condition
285285
if (isSplatted && lastArg instanceof ArrayAppendOneNode arrayAppendOneNode) {
286-
return arrayAppendOneNode.getValueNode();
286+
return RubyNode.unwrapNode(arrayAppendOneNode.getValueNode());
287287
}
288288

289289
// YARP-specific condition
@@ -294,13 +294,13 @@ private RubyNode getLastArgumentNode() {
294294
RubyNode[] elements = arrayConcatNode.getElements();
295295
assert elements.length > 0;
296296

297-
RubyNode last = elements[elements.length - 1];
297+
RubyNode last = RubyNode.unwrapNode(elements[elements.length - 1]);
298298

299299
if (last instanceof ArrayLiteralNode arrayLiteralNode) {
300300
RubyNode[] values = arrayLiteralNode.getValues();
301301
assert values.length > 0;
302302

303-
return values[values.length - 1];
303+
return RubyNode.unwrapNode(values[values.length - 1]);
304304
} else {
305305
return last;
306306
}

0 commit comments

Comments
 (0)