[Mono-bugs] [Bug 473999] New: Calling a generic function twice which calls DynamicInvoke throws exception

bugzilla_noreply at novell.com bugzilla_noreply at novell.com
Mon Feb 9 12:36:29 EST 2009


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


           Summary: Calling a generic function twice which calls
                    DynamicInvoke throws exception
    Classification: Mono
           Product: Mono: Runtime
           Version: SVN
          Platform: Other
        OS/Version: Other
            Status: NEW
          Severity: Normal
          Priority: P5 - None
         Component: misc
        AssignedTo: mono-bugs at lists.ximian.com
        ReportedBy: basjsmit at gmail.com
         QAContact: mono-bugs at lists.ximian.com
          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

using System;

public class Program
{
    static void Main()
    {
        Test(""); // this one works.
        Test(""); // this one throws.
    }

    static public void Test<T>(T a)
    {
        Func<T> func = () => a;
        func.DynamicInvoke();
    }
}


Reproducible: Always

Steps to Reproduce:
1.Compile and run

Actual Results:  
Unhandled Exception: System.Reflection.TargetException: Object does not match
target type.
  at System.Reflection.MonoMethod.Invoke (System.Object obj, BindingFlags
invokeAttr, System.Reflection.Binder binder, System.Object[] parameters,
System.Globalization.CultureInfo culture) [0x00000] 
  at System.Reflection.MethodBase.Invoke (System.Object obj, System.Object[]
parameters) [0x00000] 
  at System.Delegate.DynamicInvokeImpl (System.Object[] args) [0x00000] 
  at System.MulticastDelegate.DynamicInvokeImpl (System.Object[] args)
[0x00000] 
  at System.Delegate.DynamicInvoke (System.Object[] args) [0x00000] 
  at Program.Test[String] (System.String a) [0x00000] 
  at Program.Main () [0x00000] 


Expected Results:  
Regular execution

Works on .Net, fails on windows 2.4 preview 2 and trunk r125905 on ubuntu

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


More information about the mono-bugs mailing list