Bugzilla – Bug 321564
[GMCS] gmcs doesn't allow B[] -> IList<A> conversion where B : A.
Last modified: 2007-09-15 21:24:23 UTC
---- Reported by vargaz@gmail.com 2006-07-13 12:35:07 MST ---- Testcase: <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< using System; using System.Collections.Generic; public class A { } public class B : A { } public class Tests { public static void Main () { IList<A> a = new B [0]; Console.WriteLine (typeof (IList<A>).IsAssignableFrom (typeof (B[]))); } } <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< csc compiles this done, but gmcs fails with: bug.cs(14,12): error CS0029: Cannot implicitly convert type `B[]' to `System.Collections.Generic.IList<A>' Also, this might be a runtime problem as well, since the Console.WriteLine prints 'True' under MS, and 'False' under mono. ---- Additional Comments From martin@ximian.com 2006-07-21 07:19:16 MST ---- Created an attachment (id=170111) Patch for the GMCS part ---- Additional Comments From martin@ximian.com 2006-07-21 07:19:36 MST ---- Created an attachment (id=170112) Patch for corlib ---- Additional Comments From martin@ximian.com 2006-07-21 07:20:01 MST ---- Created an attachment (id=170113) Patch for the runtime ---- Additional Comments From martin@ximian.com 2006-07-21 10:33:03 MST ---- The gmcs patch is now in SVN. ---- Additional Comments From vargaz@gmail.com 2006-08-15 15:54:44 MST ---- *** https://bugzilla.novell.com/show_bug.cgi?id=MONO78906 has been marked as a duplicate of this bug. *** ---- Additional Comments From martin@ximian.com 2006-08-31 14:18:18 MST ---- *** https://bugzilla.novell.com/show_bug.cgi?id=MONO79145 has been marked as a duplicate of this bug. *** ---- Additional Comments From martin@ximian.com 2006-08-31 14:44:36 MST ---- Created an attachment (id=170114) Updated runtime patch ---- Additional Comments From martin@ximian.com 2006-08-31 14:46:11 MST ---- Created an attachment (id=170115) Updated corlib patch. ---- Additional Comments From martin@ximian.com 2006-08-31 14:46:43 MST ---- Created an attachment (id=170116) Updated runtime patch; this is the right patch file. ---- Additional Comments From martin@ximian.com 2006-09-01 13:49:34 MST ---- Original test case is in gtest-285.cs. ---- Additional Comments From martin@ximian.com 2006-09-01 13:59:08 MST ---- Fixed in SVN. ---- Additional Comments From martin@ximian.com 2006-09-01 13:59:51 MST ---- *** https://bugzilla.novell.com/show_bug.cgi?id=MONO77348 has been marked as a duplicate of this bug. *** This bug blocked bug(s) 77348. Imported an attachment (id=170111) Imported an attachment (id=170112) Imported an attachment (id=170113) Imported an attachment (id=170114) Imported an attachment (id=170115) Imported an attachment (id=170116) Unknown operating system unknown. Setting to default OS "Other".