return errorSuggestion;
}
- var expr = CSharpBinder.CreateCompilerExpression (argumentInfo [0], target);
- var args = CSharpBinder.CreateCompilerArguments (argumentInfo.Skip (1), indexes);
- expr = new Compiler.ElementAccess (expr, args);
- expr = new Compiler.Cast (new Compiler.TypeExpression (ReturnType, Compiler.Location.Null), expr);
+ var ctx = DynamicContext.Create ();
+ var expr = ctx.CreateCompilerExpression (argumentInfo [0], target);
+ var args = ctx.CreateCompilerArguments (argumentInfo.Skip (1), indexes);
+ expr = new Compiler.ElementAccess (expr, args, Compiler.Location.Null);
+ expr = new Compiler.Cast (new Compiler.TypeExpression (ctx.ImportType (ReturnType), Compiler.Location.Null), expr, Compiler.Location.Null);
- var restrictions = CSharpBinder.CreateRestrictionsOnTarget (target).Merge (CSharpBinder.CreateRestrictionsOnTarget (indexes));
- return CSharpBinder.Bind (this, expr, callingContext, restrictions, errorSuggestion);
+ var binder = new CSharpBinder (this, expr, errorSuggestion);
+ binder.AddRestrictions (target);
+ binder.AddRestrictions (indexes);
+
+ return binder.Bind (ctx, callingContext);
}
}
}