[Mono-bugs] [Bug 327497] New: gmcs gives spurious CS0425 when type constraints involve constrained type

bugzilla_noreply at novell.com bugzilla_noreply at novell.com
Sat Sep 22 13:44:22 EDT 2007


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

           Summary: gmcs gives spurious CS0425 when type constraints involve
                    constrained type
           Product: Mono: Compilers
           Version: 1.2
          Platform: i686
               URL: http:///
        OS/Version: Linux
            Status: NEW
          Severity: Normal
          Priority: P5 - None
         Component: C#
        AssignedTo: rharinath at novell.com
        ReportedBy: jbytheway at gmail.com
         QAContact: mono-bugs at ximian.com
          Found By: Development


Created an attachment (id=174029)
 --> (https://bugzilla.novell.com/attachment.cgi?id=174029)
Example of code exhibiting problem

Description of Problem:

When implementing a generic interface method, and when the type parameter of
the generic method has a constraint that involves both it and the interface
defining the method, e.g.:

where TOImplementer : Interface<TOImplementer>

(full example in the attached test.cs) gmcs gives an error CS0425.

Steps to reproduce the problem:
1. run "gmcs test.cs"


Actual Results:

Error as follows:

$ gmcs test.cs
test.cs(11,15): error CS0425: The constraints for type parameter
`TOImplementer' of method `Implementer.Combine<TOImplementer>()' must match the
constraints for type parameter `TOImplementer' of interface method
`Interface<TImplementer>.Combine<TOImplementer>()'. Consider using an explicit
interface implementation instead
test.cs(5,8): (Location of the symbol related to previous error)
Compilation failed: 1 error(s), 0 warnings


Expected Results:

Successful compilation.


How often does this happen? 

Always.


Additional Information:

Running using mono packages from Debian testing.  In particular, mono-gmcs
package version 1.2.5-3.

$ gmcs --version
Mono C# compiler version 1.2.5.0


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