2010-05-27 Marek Safar <marek.safar@gmail.com>
[mono.git] / mcs / class / Microsoft.CSharp / Microsoft.CSharp.RuntimeBinder / CSharpInvokeBinder.cs
index 3748ba0e5e303d940c3b1b534006b553bf25f106..ded455c50b9221aaa746c1e58a217b6ed3a5dae3 100644 (file)
@@ -55,9 +55,9 @@ namespace Microsoft.CSharp.RuntimeBinder
                        expr = new Compiler.Invocation (expr, c_args);
 
                        if ((flags & CSharpBinderFlags.ResultDiscarded) == 0)
-                               expr = new Compiler.Cast (new Compiler.TypeExpression (ReturnType, Compiler.Location.Null), expr);
+                               expr = new Compiler.Cast (new Compiler.TypeExpression (TypeImporter.Import (ReturnType), Compiler.Location.Null), expr);
                        else
-                               expr = new Compiler.DynamicResultCast (ReturnType, expr);
+                               expr = new Compiler.DynamicResultCast (TypeImporter.Import (ReturnType), expr);
 
                        var binder = new CSharpBinder (this, expr, errorSuggestion);
                        binder.AddRestrictions (target);