[Mono-dev] An issue with nested lamdas

Jb Evain jbevain at gmail.com
Wed Jan 12 07:23:08 EST 2011


Hi,

On Wed, Jan 12, 2011 at 11:48 AM, timeslip
<timeslip at users.sourceforge.net> wrote:
> I've reduced my problem down to this
> simple test case:
>
> using System;
> using System.Linq.Expressions;
>
> namespace DelegateTest {
>  static class MainClass {
>    public static int DynCall(Delegate func) {
>      return (int)func.DynamicInvoke();
>    }
>
>    public static void Main () {
>      LambdaExpression ex=Expression.Lambda(typeof(Func<int>),
>        Expression.Constant(5));
>      LambdaExpression ex2=Expression.Lambda(typeof(Func<int>),
>        Expression.Call(typeof(MainClass).GetMethod("DynCall"), ex));
>      Func<int> func=(Func<int>)ex2.Compile();
>      Console.WriteLine(func());
>    }
>  }
> }

Could you please file a bug and attach the repro there?

Thanks!

Jb


More information about the Mono-devel-list mailing list