Bugzilla – Bug 318296
[GMCS] multidimensional generic arrays do not accept subtypes of actual element type
Last modified: 2007-09-15 21:24:46 UTC
---- Reported by nazgul@omega.pl 2005-06-17 16:09:22 MST ---- Please fill in this template when reporting a bug, unless you know what you are doing. Description of Problem: You cannot store Nil<int> : list<int> in list<int>[,] Steps to reproduce the problem: 1. Compile gmcs t.cs class list <a> { } class Nil <a> : list <a> { public static Nil <a> single; static Nil () { single = new Nil <a> (); } } public class Test { public static void Main() { list <int>[,] x = new list<int>[10,10]; x[0,0] = Nil <int>.single; } } 2. Run mono t.exe Actual Results: Unhandled Exception: System.ArrayTypeMismatchException: Source array type cannot be assigned to destination array type. in (wrapper managed-to-native) System.Object:__icall_wrapper_helper_stelem_ref_check (object,object) in <0x00031> Test:Main () Expected Results: clear run How often does this happen? Always Additional Information: ---- Additional Comments From martin@ximian.com 2005-06-20 12:56:44 MST ---- Fixed in SVN. Unknown bug field "cf_op_sys_details" encountered while moving bug <cf_op_sys_details>mono svn from 17.06.2005</cf_op_sys_details> Unknown operating system unknown. Setting to default OS "Other".