[Mono-bugs] [Bug 685908] New: Excessive boxing

bugzilla_noreply at novell.com bugzilla_noreply at novell.com
Thu Apr 7 11:14:09 EDT 2011


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: lupus at novell.com
        ReportedBy: msafar at novell.com
         QAContact: mono-bugs at lists.ximian.com
          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.


More information about the mono-bugs mailing list