Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: jruby/jruby
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: c390168e6856
Choose a base ref
...
head repository: jruby/jruby
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: c81c55ee4db2
Choose a head ref
  • 3 commits
  • 2 files changed
  • 2 contributors

Commits on Dec 23, 2015

  1. Revert "Revert "Symbol#to_proc procs' #parameters always return [[:re…

    …st]].""
    
    This reverts commit 870ac98.
    
    Forgot to use anonrest for an anon rest. Will make the error more
    obvious in a subsequent commit.
    headius committed Dec 23, 2015
    Copy the full SHA
    3e3be35 View commit details
  2. Copy the full SHA
    4f866e2 View commit details
  3. Copy the full SHA
    c81c55e View commit details
Showing with 11 additions and 1 deletion.
  1. +6 −0 core/src/main/java/org/jruby/RubySymbol.java
  2. +5 −1 core/src/main/java/org/jruby/runtime/ArgumentDescriptor.java
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;
}