Bugzilla – Bug 321411
[GMCS] nested class and constraints
Last modified: 2007-11-05 12:25:20 UTC
---- Reported by kjo22@cornell.edu 2006-06-21 19:36:31 MST ---- Another example of broken generic support. I removed unimportant parts. While parsing the "where" clause, your compiler complains that Refcollection<K,T> doesn't have member "Element", even though it's there. The same compiles without problems in Visual Studio. public class RefCollection<K,T> : IRefCollection<K,T> where T : RefCollection<K,T>.Element, new() where K : System.IComparable, System.IComparable<K> { public abstract class Element : Collections2.BTNOf<K>, System.IDisposable { ... } ... } ---- Additional Comments From martin@ximian.com 2006-06-21 20:23:34 MST ---- And this is working for me. Setting Priority to a sane value anyways. ---- Additional Comments From krzys@cs.cornell.edu 2006-06-21 21:47:28 MST ---- I've cut out too much, that's all. The following breaks the compiler. -------------------------------------- public interface IA<K> where K : System.IComparable, System.IComparable<K> { } public class A<K> : IA<K> where K : System.IComparable, System.IComparable<K> { } public interface IB<K,T> where T : System.IDisposable { } public class B<K,T> : IB<K,T> where T : B<K,T>.Element, new() where K : System.IComparable, System.IComparable<K> { public abstract class Element : A<K> { } } ---- Additional Comments From martin@ximian.com 2006-07-21 10:35:04 MST ---- Works for me. Unknown operating system unknown. Setting to default OS "Other".
No response, closing.