[Mono-bugs] [Bug 350839] New: Anonymous methods mask errors during type conversion.

bugzilla_noreply at novell.com bugzilla_noreply at novell.com
Thu Dec 27 13:55:32 EST 2007


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


           Summary: Anonymous methods mask errors during type conversion.
           Product: Mono: Compilers
           Version: unspecified
          Platform: Other
        OS/Version: Other
            Status: NEW
          Severity: Normal
          Priority: P5 - None
         Component: C#
        AssignedTo: mono-bugs at ximian.com
        ReportedBy: miguel at novell.com
         QAContact: mono-bugs at ximian.com
          Found By: ---


The following program masks the actual error, and it becomes difficult to
determine what the problem is inside an anonymous method:

using System;
using System.Threading;

class X {
        static void Main ()
        {
        }

        void D ()
        {
                Thread t = new Thread (delegate (object state){
                        M (1);
                });
        }

        void M (string s){
        }
}


The output currently is:

/tmp/th.cs(11,40): error CS1593: Delegate `System.Threading.ThreadStart' does
not take `1' arguments
/tmp/th.cs(11,40): error CS1661: Cannot convert `anonymous method' to delegate
type `System.Threading.ThreadStart' since there is a parameter mismatch

While MS reports that the error is in the invocation of "M()" because there is
no conversion from integer to string.


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