Add EntityFramework (not same as System.Data.Entity)
[mono.git] / mcs / class / Microsoft.CSharp / Microsoft.CSharp.RuntimeBinder / CSharpGetIndexBinder.cs
index 966b15831d9c08bb3b702fc9fe975eae242f52f3..367cc22b70e1a63c50a50fc53a577e506f153cf3 100644 (file)
@@ -55,16 +55,17 @@ namespace Microsoft.CSharp.RuntimeBinder
                                return errorSuggestion;
                        }
 
-                       var expr = CSharpBinder.CreateCompilerExpression (argumentInfo [0], target);
-                       var args = CSharpBinder.CreateCompilerArguments (argumentInfo.Skip (1), indexes);
+                       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 (TypeImporter.Import (ReturnType), Compiler.Location.Null), expr, Compiler.Location.Null);
+                       expr = new Compiler.Cast (new Compiler.TypeExpression (ctx.ImportType (ReturnType), Compiler.Location.Null), expr, Compiler.Location.Null);
 
                        var binder = new CSharpBinder (this, expr, errorSuggestion);
                        binder.AddRestrictions (target);
                        binder.AddRestrictions (indexes);
 
-                       return binder.Bind (callingContext, target);
+                       return binder.Bind (ctx, callingContext);
                }
        }
 }