Bugzilla – Bug 321410
[GMCS] "recursive" constraints
Last modified: 2007-09-15 21:24:23 UTC
---- Reported by kjo22@cornell.edu 2006-06-21 19:30:12 MST ---- The following doesn't compile in Mono, although it should (and it does compile in Visual Studio). Your compiler complains about the AVLNode definition, claiming that C is not known to be IBSTNode, although it's clearly so for it is IAVLNode that inherits IBSTNode. This is just one of many examples in which your C# compiler crashes on generics code, for it cannot properly process circular dependencies. public interface INode<K> : IComparable<K> where K : IComparable<K> { K Key { get; } } public interface IBTNode<C> where C : IBTNode<C> { C Parent { get; set; } C Left { get; set; } C Right { get; set; } } public interface IBSTNode<K, C> : IBTNode<C>, INode<K> where C : IBSTNode<K, C> where K : IComparable<K> { } public interface IAVLNode<K, C> : IBSTNode<K, C> where C : IAVLNode<K, C> where K : IComparable<K> { int Balance { get; set; } } ---- Additional Comments From martin@ximian.com 2006-06-21 20:20:24 MST ---- Setting priority to a sane value and fixing summary. ---- Additional Comments From martin@ximian.com 2006-06-21 20:41:59 MST ---- Slightly modified version of #78380, but with interfaces instead of classes. ---- Additional Comments From martin@ximian.com 2006-06-21 22:22:06 MST ---- Fixed in SVN. Unknown operating system unknown. Setting to default OS "Other".