if (value.LimitType == typeof (object))
return new Compiler.NullLiteral (Compiler.Location.Null);
- return new Compiler.NullConstant (value.LimitType, Compiler.Location.Null);
+ InitializeCompiler (null);
+ return Compiler.Constant.CreateConstant (value.LimitType, null, Compiler.Location.Null);
}
if (info != null) {
{
var res = new Compiler.Arguments (args.Length);
int pos = 0;
+
+ // enumerates over args
foreach (var item in info) {
var expr = CreateCompilerExpression (item, args [pos++]);
if (item.IsNamed) {
} else {
res.Add (new Compiler.Argument (expr, item.ArgumentModifier));
}
+
+ if (pos == args.Length)
+ break;
}
return res;
Compiler.TypeManager.InitOptionalCoreTypes (ctx);
}
}
-
- public static DynamicMetaObject Bind (DynamicMetaObject target, DynamicMetaObject errorSuggestion, DynamicMetaObject[] args)
- {
- return Bind (target, errorSuggestion);
- }
-
- public static DynamicMetaObject Bind (DynamicMetaObject target, DynamicMetaObject errorSuggestion)
- {
- return errorSuggestion ??
- new DynamicMetaObject (
- Expression.Constant (new object ()),
- target.Restrictions.Merge (
- BindingRestrictions.GetTypeRestriction (
- target.Expression, target.LimitType)));
- }
}
}
public override DynamicMetaObject FallbackInvokeMember (DynamicMetaObject target, DynamicMetaObject[] args, DynamicMetaObject errorSuggestion)
{
- return CSharpBinder.Bind (target, errorSuggestion, args);
-/*
- var expr = CSharpBinder.CreateCompilerExpression (argumentInfo[0], target);
+ var expr = CSharpBinder.CreateCompilerExpression (argumentInfo [0], target);
var c_args = CSharpBinder.CreateCompilerArguments (argumentInfo.Skip (1), args);
+ var t_args = typeArguments == null ?
+ null :
+ new Compiler.TypeArguments (typeArguments.Select (l => new Compiler.TypeExpression (l, Compiler.Location.Null)).ToArray ());
- expr = new Compiler.MemberAccess (expr, Name, null, Compiler.Location.Null);
+ expr = new Compiler.MemberAccess (expr, Name, t_args, Compiler.Location.Null);
expr = new Compiler.Invocation (expr, c_args);
if ((flags & CSharpBinderFlags.ResultDiscarded) == 0)
CSharpBinder.CreateRestrictionsOnTarget (args));
return CSharpBinder.Bind (this, expr, callingContext, restrictions, errorSuggestion);
-*/
}
}
}
}
var expr = CSharpBinder.CreateCompilerExpression (argumentInfo [0], target);
- var args = CSharpBinder.CreateCompilerArguments (argumentInfo.Skip (2), indexes);
+ var args = CSharpBinder.CreateCompilerArguments (argumentInfo.Skip (1), indexes);
expr = new Compiler.ElementAccess (expr, args);
- var source = CSharpBinder.CreateCompilerExpression (argumentInfo[1], value);
+ var source = CSharpBinder.CreateCompilerExpression (argumentInfo [indexes.Length + 1], value);
expr = new Compiler.SimpleAssign (expr, source);
expr = new Compiler.Cast (new Compiler.TypeExpression (ReturnType, Compiler.Location.Null), expr);
+2009-10-30 Marek Safar <marek.safar@gmail.com>
+
+ * CSharpBinder.cs, CSharpInvokeMemberBinder.cs,
+ CSharpSetIndexBinder.cs: Simple member binder.
+
2009-10-23 Marek Safar <marek.safar@gmail.com>
* RuntimeBinderContext.cs, Extensions.cs, CSharpBinder.cs: More