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


           Summary: Compilation error with explicit interface
                    implementations and constraints
           Product: Mono: Compilers
           Version: SVN
          Platform: Other
        OS/Version: Other
            Status: NEW
          Severity: Normal
          Priority: P5 - None
         Component: C#
        AssignedTo: [email protected]
        ReportedBy: [EMAIL PROTECTED]
         QAContact: [email protected]
          Found By: ---


SVN 102582.

Testcase:

public class RuleBuilder<T> where T : class {}

public interface IDynamicObject {
    RuleBuilder<T> GetRule<T>() where T : class;
}

public class RubyMethod : IDynamicObject {
    RuleBuilder<T> IDynamicObject.GetRule<T>() /* where T : class */ {
        return new RuleBuilder<T>();
    }
}

Result:

Test.cs(8,5): error CS0452: The type `T' must be a reference type in order to
use it as type parameter `T' in the generic type or method `RuleBuilder<T>'.

If you uncomment the constraint:

Test.cs(8,35): error CS0460: `RubyMethod.IDynamicObject.GetRule<T>()': Cannot
specify constraints for overrides or explicit interface implementation methods

Compiles fine on csc.

Blocks compiling IronRuby SVN r101.


-- 
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.
_______________________________________________
mono-bugs maillist  -  [email protected]
http://lists.ximian.com/mailman/listinfo/mono-bugs

Reply via email to