//
using System;
+using System.Dynamic;
using System.Collections.Generic;
+using System.Linq;
namespace Microsoft.CSharp.RuntimeBinder
{
public string Name {
get { return name; }
}
+
+ internal static CallInfo CreateCallInfo (IEnumerable<CSharpArgumentInfo> argumentInfo, int skipCount)
+ {
+ var named = from arg in argumentInfo.Skip (skipCount) where arg.IsNamed select arg.Name;
+ return new CallInfo (Math.Max (0, argumentInfo.Count () - skipCount), named);
+ }
}
}
Type callingContext;
public CSharpGetIndexBinder (Type callingContext, IEnumerable<CSharpArgumentInfo> argumentInfo)
- : base (argumentInfo.ToCallInfo ())
+ : base (CSharpArgumentInfo.CreateCallInfo (argumentInfo, 1))
{
this.callingContext = callingContext;
this.argumentInfo = argumentInfo.ToReadOnly ();
Type callingContext;
public CSharpInvokeBinder (CSharpCallFlags flags, Type callingContext, IEnumerable<CSharpArgumentInfo> argumentInfo)
- : base (argumentInfo.ToCallInfo ())
+ : base (CSharpArgumentInfo.CreateCallInfo (argumentInfo, 1))
{
this.flags = flags;
this.callingContext = callingContext;
Type callingContext;
public CSharpInvokeMemberBinder (CSharpCallFlags flags, string name, Type callingContext, IEnumerable<Type> typeArguments, IEnumerable<CSharpArgumentInfo> argumentInfo)
- : base (name, false, argumentInfo.ToCallInfo ())
+ : base (name, false, CSharpArgumentInfo.CreateCallInfo (argumentInfo, 1))
{
this.flags = flags;
this.callingContext = callingContext;
Type callingContext;
public CSharpSetIndexBinder (Type callingContext, IEnumerable<CSharpArgumentInfo> argumentInfo)
- : base (argumentInfo.ToCallInfo ())
+ : base (CSharpArgumentInfo.CreateCallInfo (argumentInfo, 2))
{
this.callingContext = callingContext;
this.argumentInfo = argumentInfo.ToReadOnly ();
+2009-08-07 Marek Safar <marek.safar@gmail.com>
+
+ * CSharpInvokeBinder.cs, CSharpGetIndexBinder.cs, Extensions.cs,
+ CSharpArgumentInfo.cs, CSharpInvokeMemberBinder.cs,
+ CSharpSetIndexBinder.cs: Skip overhead arguments.
+
2009-08-04 Marek Safar <marek.safar@gmail.com>
* RuntimeBinderInternalCompilerException.cs,
return col == null ?
new ReadOnlyCollectionBuilder<T> (0) :
new ReadOnlyCollectionBuilder<T> (col);
- }
-
- public static CallInfo ToCallInfo (this IEnumerable<CSharpArgumentInfo> argumentInfo)
- {
- var named = from arg in argumentInfo where arg.IsNamed select arg.Name;
- return new CallInfo (argumentInfo.Count (), named);
- }
+ }
}
}