[Mono-bugs] [Bug 75366][Maj] Changed - [PATCH] SRE uses Reflected not Declaring type for token

bugzilla-daemon at bugzilla.ximian.com bugzilla-daemon at bugzilla.ximian.com
Thu Jun 30 05:25:09 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 nazgul at omega.pl.

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

--- shadow/75366	2005-06-29 20:44:07.000000000 -0400
+++ shadow/75366.tmp.18168	2005-06-30 05:25:09.000000000 -0400
@@ -123,6 +123,37 @@
 There are also other errors. I can try to create a testcase, but
 probably they will appear also in standard mono tests.
 
 ------- Additional Comments From bmaurer at users.sf.net  2005-06-29 20:44 -------
 I'd really appreciate a test case if you can get one. Can you also try
 just applying teh first segment of the patch.
+
+------- Additional Comments From nazgul at omega.pl  2005-06-30 05:25 -------
+With this patch gmcs generates incorrect IL for the following C# program:
+
+public class list <T> {
+  public class Cons : list <T> {
+        public T hd;
+        public list <T> tl;
+  }
+}
+class M {
+  static void Main () {
+        list <int> x = new list<int>.Cons ();
+        int y = ((list<int>.Cons)x).hd;
+        list <string> z = new list<string>.Cons ();
+        string w = ((list<string>.Cons)z).hd;
+  }
+}
+
+It is 
+  IL_0019:  castclass  class list`1/Cons<string>
+  IL_001e:  ldfld      !0 class list`1/Cons<!0>::hd
+with the patch
+
+and
+  IL_0019:  castclass  class list`1/Cons<string>
+  IL_001e:  ldfld      !0 class list`1/Cons<string>::hd
+
+before
+
+


More information about the mono-bugs mailing list