[Mono-bugs] [Bug 78686][Blo] New - Cannot properly handle generics.

bugzilla-daemon at bugzilla.ximian.com bugzilla-daemon at bugzilla.ximian.com
Wed Jun 21 19:30:13 EDT 2006


Please do not reply to this email- if you want to comment on the bug, go to the
URL shown below and enter your comments there.

Changed by kjo22 at cornell.edu.

http://bugzilla.ximian.com/show_bug.cgi?id=78686

--- shadow/78686	2006-06-21 19:30:13.000000000 -0400
+++ shadow/78686.tmp.13380	2006-06-21 19:30:13.000000000 -0400
@@ -0,0 +1,68 @@
+Bug#: 78686
+Product: Mono: Compilers
+Version: 1.1
+OS: 
+OS Details: 
+Status: NEW   
+Resolution: 
+Severity: 
+Priority: Blocker
+Component: C#
+AssignedTo: rharinath at novell.com                            
+ReportedBy: kjo22 at cornell.edu               
+QAContact: mono-bugs at ximian.com
+TargetMilestone: ---
+URL: 
+Summary: Cannot properly handle generics.
+
+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;
+        }
+    }


More information about the mono-bugs mailing list