Bugzilla – Bug 318307
[GMCS] gmcs cannot compile access to static generic field
Last modified: 2007-09-15 21:24:23 UTC
---- Reported by nazgul@omega.pl 2005-06-18 15:50:29 MST ---- Please fill in this template when reporting a bug, unless you know what you are doing. Description of Problem: Gmcs refuses to compile accessing static field of nested generic class. Steps to reproduce the problem: 1. Copile with gmcs t.cs /r:tlib.dll public class A <T> { public class Nil : A <T> { public static Nil _N_constant_object = new Nil (); } } 2. Try to compile gmcs t.cs /r:tlib2.dll class M { static void Main () { A <int> x = A<int>.Nil._N_constant_object; } } 3. Actual Results: t.cs(3) error CS0029: Cannot convert implicitly from `A`1.Nil[[T]]' to `A`1[[System.Int32, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]]' Compilation failed: 1 error(s), 0 warnings Expected Results: Compilation succeded How often does this happen? Always Additional Information: ---- Additional Comments From martin@ximian.com 2005-06-21 06:12:40 MST ---- *** This bug has been marked as a duplicate of https://bugzilla.novell.com/show_bug.cgi?id=MONO75320 *** Unknown bug field "cf_op_sys_details" encountered while moving bug <cf_op_sys_details>mono svn 17.06.2005</cf_op_sys_details> Unknown operating system unknown. Setting to default OS "Other". This bug was marked DUPLICATE in the database it was moved from. Changing resolution to "MOVED"