protected override ActualArguments CreateActualArguments(IList<DynamicMetaObject> namedArgs, IList<string> argNames, int preSplatLimit, int postSplatLimit) {
var result = new List<DynamicMetaObject>();
// self (instance):
if (_callConvention == SelfCallConvention.SelfIsInstance) {
result.Add(_args.MetaTarget);
}
if (_args.Signature.HasBlock) {
if (_args.GetBlock() == null) {
// the user explicitly passed nil as a block arg:
result.Add(NullMetaBlockParam);
} else {
// pass BlockParam:
if (_metaBuilder.BfcVariable == null) {
// we add temporary even though we might not us it if the calee doesn't have block param arg:
_metaBuilder.BfcVariable = _metaBuilder.GetTemporary(typeof(BlockParam), "#bfc");
}
result.Add(new DynamicMetaObject(_metaBuilder.BfcVariable, BindingRestrictions.Empty));
}
} else {
// no block passed into a method with a BlockParam:
result.Add(MissingBlockParam.Meta.Instance);
}
// self (parameter):
if (_callConvention == SelfCallConvention.SelfIsParameter) {
result.Add(_args.MetaTarget);
}
// the next argument is the first one for which we use restrictions coming from overload resolution:
_firstRestrictedArg = result.Count;
// hidden args: block, self
int hidden = _callConvention == SelfCallConvention.NoSelf ? 1 : 2;
return CreateActualArguments(result, _metaBuilder, _args, hidden, preSplatLimit, postSplatLimit, out _lastSplattedArg, out _list, out _listVariable);
}