[Mono-bugs] [Bug 645765] New: Missing support for hoisted parameters in the Expression Tree interpreter

bugzilla_noreply at novell.com bugzilla_noreply at novell.com
Tue Oct 12 09:43:57 EDT 2010


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

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


           Summary: Missing support for hoisted parameters in the
                    Expression Tree interpreter
    Classification: Mono
           Product: Mono: Class Libraries
           Version: SVN
          Platform: Other
        OS/Version: Other
            Status: NEW
          Severity: Normal
          Priority: P5 - None
         Component: Sys.Core
        AssignedTo: jbevain at novell.com
        ReportedBy: jbevain at novell.com
         QAContact: mono-bugs at lists.ximian.com
          Found By: ---
           Blocker: ---


Unit tests:

        [Test]
        public void SimpleHoistedParameter ()
        {
            var p = Expression.Parameter (typeof (string), "s");

            var f = Expression.Lambda<Func<string, Func<string>>> (
                Expression.Lambda<Func<string>> (
                    p,
                    new ParameterExpression [0]),
                p).Compile ();

            var f2 = f ("x");

            Assert.AreEqual ("x", f2 ());
        }

        [Test]
        public void HoistedParameter ()
        {
            var i = Expression.Parameter (typeof (int), "i");

            var l = Expression.Lambda<Func<int, string>> (
                Expression.Invoke (
                    Expression.Lambda<Func<string>> (
                        Expression.Call (i, typeof (int).GetMethod ("ToString",
Type.EmptyTypes)))), i).Compile ();

            Assert.AreEqual ("42", l (42));
        }

Are not working with the expression interpreter. It's needed for complex
queries.

-- 
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