https://bugzilla.novell.com/show_bug.cgi?id=475823


           Summary: ExpressionType.NodeType yield different results when
                    compiled on gmcs vc csc
    Classification: Mono
           Product: Mono: Compilers
           Version: SVN
          Platform: Other
        OS/Version: Other
            Status: NEW
          Severity: Normal
          Priority: P5 - None
         Component: C#
        AssignedTo: [email protected]
        ReportedBy: [email protected]
         QAContact: [email protected]
          Found By: ---


User-Agent:       Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.0.6)
Gecko/2009011913 Firefox/3.0.6

Isolated another Moq related gmcs bug. When executed, on either mono or .net,
the code below yields different results when compiled on csc or gmcs.

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); // Changing Foo to object hides the bug
}


Reproducible: Always

Steps to Reproduce:
1.Compile with gmcs and csc
2.Compare results by running both executables

Actual Results:  
Different code paths are followed


Expected Results:  
Same code paths are followed


Compiled with mcs Revision: 126638 on ubuntu, error occurs when run on mono
trunk r126638 or on .net

-- 
Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the QA contact for the bug.
You are the assignee for the bug.
_______________________________________________
mono-bugs maillist  -  [email protected]
http://lists.ximian.com/mailman/listinfo/mono-bugs

Reply via email to