Skip to content

Commit 7039d7b

Browse files
committed
Fix last super spec
1 parent 2b84599 commit 7039d7b

File tree

2 files changed

+10
-3
lines changed

2 files changed

+10
-3
lines changed

spec/tags/language/super_tags.txt

Lines changed: 0 additions & 1 deletion
This file was deleted.

src/main/java/org/truffleruby/language/supercall/ReadZSuperArgumentsNode.java

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2013, 2019 Oracle and/or its affiliates. All rights reserved. This
2+
* Copyright (c) 2013, 2020 Oracle and/or its affiliates. All rights reserved. This
33
* code is released under a tri EPL/GPL/LGPL license. You can use it,
44
* redistribute it and/or modify it under the terms of the:
55
*
@@ -48,7 +48,15 @@ public final Object execute(VirtualFrame frame) {
4848

4949
if (restArgIndex != -1) {
5050
final Object restArg = superArguments[restArgIndex];
51-
final Object[] restArgs = unsplat((RubyArray) restArg);
51+
52+
final Object[] restArgs;
53+
54+
if (restArg instanceof RubyArray) {
55+
restArgs = unsplat((RubyArray) restArg);
56+
} else {
57+
restArgs = new Object[]{restArg};
58+
}
59+
5260
final int after = superArguments.length - (restArgIndex + 1);
5361
Object[] splattedArguments = ArrayUtils.copyOf(superArguments, superArguments.length + restArgs.length - 1);
5462
ArrayUtils.arraycopy(

0 commit comments

Comments
 (0)