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

https://bugzilla.novell.com/show_bug.cgi?id=685908#c0


           Summary: Excessive boxing
    Classification: Mono
           Product: Mono: Runtime
           Version: SVN
          Platform: Other
        OS/Version: Other
            Status: NEW
          Severity: Normal
          Priority: P5 - None
         Component: JIT
        AssignedTo: [email protected]
        ReportedBy: [email protected]
         QAContact: [email protected]
          Found By: ---
           Blocker: ---


// The test comes from VS breaking changes doc

using System;
using System.Linq;
using System.Linq.Expressions;

class Program
{
    static void Main ()
    {
        Test<S> ();
    }

    static void Test<T> () where T : I
    {
        Expression<Func<T, int>> e = l => l.SetValue () + l.Value;
        var arg = default (T);
        Console.WriteLine (e.Compile () (arg));
    }
}

interface I
{
    int Value { get; }
    int SetValue ();
}

struct S : I
{
    int value;

    public int Value {
        get {
            return value;
        }
    }

    public int SetValue ()
    {
        value = 5;
        return 0;
    }
}


Compile & Run

Mono: 0
NET: 5

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

Reply via email to