[Mono-bugs] [Bug 447984] New: Compilation Failure for Valid C# Code

bugzilla_noreply at novell.com bugzilla_noreply at novell.com
Sat Nov 22 19:14:30 EST 2008


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


           Summary: Compilation Failure for Valid C# Code
           Product: Mono: Compilers
           Version: 2.0.x
          Platform: x86
        OS/Version: Windows XP
            Status: NEW
          Severity: Normal
          Priority: P5 - None
         Component: C#
        AssignedTo: mono-bugs at lists.ximian.com
        ReportedBy: mike.rettig at gmail.com
         QAContact: mono-bugs at lists.ximian.com
          Found By: ---


Description of Problem:

Mono Compiler fails to compile valid c# code. Seems to have problems with the 
combination of generics, an overloaded method, and delegates.

Steps to reproduce the problem:

Attempt to compile this code as an assembly:

using System;
using System.Collections.Generic;

namespace OverloadTest
{
        public interface MyInterface<T>
        {
                void Invoke(T target);
        }

    public class MyClass<T>
    {

        public bool Method(MyInterface<T> obj)
        {
                return Method(obj.Invoke);
        }

        public bool Method(Action<T> myAction)
        {
                return true;
        }
    }

}




Actual Results:

C:\apps\Mono-2.0.1\bin>gmcs overload.cs
overload.cs(16,35): error CS0654: Method
`OverloadTest.MyInterface`1[T].Invoke()
' is referenced without parentheses
Compilation failed: 1 error(s), 0 warnings

Expected Results:

Successful compile

How often does this happen? 

Always

Additional Information:

Code compiles fine with Microsoft c# compiler.


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