[Mono-bugs] [Bug 75329][Wis] New - gmcs 1.1.8 crash when compiling a bit strange classes (see below)

bugzilla-daemon at bugzilla.ximian.com bugzilla-daemon at bugzilla.ximian.com
Mon Jun 20 14:55:51 EDT 2005

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 jan.oravec at 6com.sk.


--- shadow/75329	2005-06-20 14:55:50.000000000 -0400
+++ shadow/75329.tmp.18272	2005-06-20 14:55:51.000000000 -0400
@@ -0,0 +1,68 @@
+Bug#: 75329
+Product: Mono: Compilers
+Version: 1.1
+OS Details: 
+Status: NEW   
+Priority: Wishlist
+Component: C#
+AssignedTo: mono-bugs at ximian.com                            
+ReportedBy: jan.oravec at 6com.sk               
+QAContact: mono-bugs at ximian.com
+TargetMilestone: ---
+Summary: gmcs 1.1.8 crash when compiling a bit strange classes (see below)
+Description of Problem:
+gmcs crash when compiling the following code:
+public class Foo<T> where T:Foo<T>
+  public T n;
+  public T next()
+  {
+    return n;
+  }
+public class Goo : Foo<Goo>
+  public int x;
+public class Test
+  public static void Main()
+  {
+    Goo x = new Goo();
+    x=x.next();
+  }
+The classes above are defined in a little strange way. The problem is
+probably in their cyclic definition. I was trying to achieve definition of
+linked list node (class Foo) without any data enclosed in it with the
+capability of adding data by inheritance (class Goo) while requiring that
+the next() function returns object of the same type so explicit casts are
+not needed.
+Steps to reproduce the problem:
+1. save the code above to file test.cs
+2. run gmcs test.cs
+3. get a segmentation fault error
+Actual Results:
+Expected Results:
+compile cleanly
+How often does this happen? 

More information about the mono-bugs mailing list