throw context.getRuntime().newArgumentError("wrong number of arguments (" + args.length + " for 2)");
}
}
private DynamicMethod createProcMethod(String name, Visibility visibility, RubyProc proc) {
Block block = proc.getBlock();
block.getBinding().getFrame().setKlazz(this);
block.getBinding().getFrame().setName(name);
block.getBinding().setMethod(name);
StaticScope scope = block.getBody().getStaticScope();
// for zsupers in define_method (blech!) we tell the proc scope to act as the "argument" scope
scope.makeArgumentScope();
Arity arity = block.arity();
// just using required is broken...but no more broken than before zsuper refactoring
scope.setRequiredArgs(arity.required());
if(!arity.isFixed()) {
scope.setRestArg(arity.required());