Skip to content

Commit

Permalink
Showing 2 changed files with 11 additions and 1 deletion.
6 changes: 6 additions & 0 deletions core/src/main/java/org/jruby/RubySymbol.java
Original file line number Diff line number Diff line change
@@ -43,6 +43,7 @@
import org.jruby.ast.util.ArgsUtil;
import org.jruby.compiler.Constantizable;
import org.jruby.parser.StaticScope;
import org.jruby.runtime.ArgumentDescriptor;
import org.jruby.runtime.Block;
import org.jruby.runtime.BlockBody;
import org.jruby.runtime.CallSite;
@@ -519,6 +520,11 @@ public String getFile() {
public int getLine() {
return -1;
}

@Override
public ArgumentDescriptor[] getArgumentDescriptors() {
return ArgumentDescriptor.ANON_REST;
}
};

return RubyProc.newProc(context.runtime,
6 changes: 5 additions & 1 deletion core/src/main/java/org/jruby/runtime/ArgumentDescriptor.java
Original file line number Diff line number Diff line change
@@ -14,9 +14,13 @@ public class ArgumentDescriptor {
public final String name;

public static final ArgumentDescriptor[] EMPTY_ARRAY = new ArgumentDescriptor[0];
public static final ArgumentDescriptor[] ANON_REST = {new ArgumentDescriptor(ArgumentType.anonrest)};

public ArgumentDescriptor(ArgumentType type, String name) {
assert name != null || type.anonymous : "null argument name given for non-anonymous argument type";
if (name == null && !type.anonymous) {
throw new RuntimeException("null argument name given for non-anonymous argument type");
}

this.type = type;
this.name = name;
}

0 comments on commit bbe61ef

Please sign in to comment.