[Mono-dev] Isolated another Moq related gmcs bug

Bas Smit basjsmit at gmail.com
Fri Feb 13 14:36:41 EST 2009


Hi guys,

another Moq related gmcs bug, when executed, the code below yields different
results when compiled with gmcs or csc. Bug submitted here:
https://bugzilla.novell.com/show_bug.cgi?id=475823

Regards, Bas


using System;
using System.Linq.Expressions;

public class Program
{
    static void Main()
    {
        Expression<Action<IHelper>> e = (helper => helper.DoIt(null));

        var mce = e.Body as MethodCallExpression;
        var et = mce.Arguments[0].NodeType;
        if (et == ExpressionType.Convert)
            Console.WriteLine("Hi from gmcs");
        else
            Console.WriteLine("Hi from csc");
    }
}

public class Foo { }

public interface IHelper
{
    void DoIt(Foo foo);
}
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.ximian.com/pipermail/mono-devel-list/attachments/20090213/c20159d8/attachment-0001.html 


More information about the Mono-devel-list mailing list