[Mono-bugs] [Bug 617161] NRE in dynamic method with nullable types

bugzilla_noreply at novell.com bugzilla_noreply at novell.com
Thu Jun 24 14:34:26 EDT 2010



Zoltan Varga <vargaz at gmail.com> changed:

           What    |Removed                     |Added
                 CC|                            |vargaz at gmail.com

--- Comment #1 from Zoltan Varga <vargaz at gmail.com> 2010-06-24 18:34:25 UTC ---
Reduced testcase:


using System;

public class Tests
    public static long? foo (object o, long? bar) {
                Console.WriteLine (o);
        return 5;

    public static int Main () {
        var del = (Func<long?,long?>)Delegate.CreateDelegate
(typeof(Func<long?,long?>), null, typeof (Tests).GetMethod ("foo"), true);

        var l = del (5);

        return 0;

This is a bug in the 'closed over a null reference' feature, i.e. calling a
static method with its first argument set to null. No idea how this worked
before, it seems to fail with 2.6 too.

Configure bugmail: http://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