Bugzilla – Bug 321412
[GMCS] conversion missing
Last modified: 2007-11-05 12:27:35 UTC
---- Reported by krzys@cs.cornell.edu 2006-06-21 21:34:58 MST ---- interface IA<C> where C : A<C> { } class A<C> : IA<A<C>> { } error CS0309: The type `A<C>' must be convertible to `A<A<C>>' in order to use it as parameter `C' in the generic type or method `IA<C>' Works in Visual Studio. ---- Additional Comments From martin@ximian.com 2006-06-22 05:18:58 MST ---- We are correctly reporting the CS0309 here. ---- Additional Comments From krzys@cs.cornell.edu 2006-06-22 10:15:55 MST ---- I've cut out too much. Here's a more comprehensive example. It doesn't compile in Mono, but it does compiles in VS2005, and it's a perfectly legal C# code. error CS0309: The type `E<K,C>' must be convertible to `ID<K,E<K,C>>' in order to use it as parameter `C' in the generic type or method `ID<K,C>' ------------------------ public interface IA<K> : System.IComparable<K> where K : System.IComparable<K> { } public interface IB<C> where C : IB<C> { } public interface IC<K, C> : IB<C>, IA<K> where C : IC<K, C> where K : System.IComparable<K> { } public interface ID<K, C> : IC<K, C> where C : ID<K, C>, IC<K, C> where K : System.IComparable<K> { } public class E<K, C> : ID<K, E<K, C>> where C : IA<K> where K : System.IComparable<K> { int IComparable<K>.CompareTo(K other) { return 0; } } ---- Additional Comments From martin@ximian.com 2006-10-12 09:47:57 MST ---- Works for me. Unknown operating system unknown. Setting to default OS "Other".
No response, closing.