[Mono-bugs] [Bug 387040] Blocks IronRuby: Compilation error with explicit interface implementations and constraints

bugzilla_noreply at novell.com bugzilla_noreply at novell.com
Wed May 7 16:11:08 EDT 2008


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

User cjcollier at colliertech.org added comment
https://bugzilla.novell.com/show_bug.cgi?id=387040#c2


C.J. Collier <cjcollier at colliertech.org> changed:

           What    |Removed                                         |Added
----------------------------------------------------------------------------
                 CC|                                                |cjcollier at colliertech.org




--- Comment #2 from C.J. Collier <cjcollier at colliertech.org>  2008-05-07 14:11:08 MST ---
Seo,

I've added this (currently failing) test to the regression suite:

http://anonsvn.mono-project.com/source/trunk/mcs/tests/ChangeLog

Cheers,

C.J.

(In reply to comment #0 from Sanghyeon Seo)
> 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.


More information about the mono-bugs mailing list