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 [EMAIL PROTECTED]

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

--- shadow/78847        2006-07-13 12:35:07.000000000 -0400
+++ shadow/78847.tmp.19794      2006-07-13 12:35:07.000000000 -0400
@@ -0,0 +1,49 @@
+Bug#: 78847
+Product: Mono: Compilers
+Version: 1.0
+OS: 
+OS Details: 
+Status: NEW   
+Resolution: 
+Severity: 
+Priority: Normal
+Component: C#
+AssignedTo: [EMAIL PROTECTED]                            
+ReportedBy: [EMAIL PROTECTED]               
+QAContact: [EMAIL PROTECTED]
+TargetMilestone: ---
+URL: 
+Cc: 
+Summary: [GMCS] gmcs doesn't allow B[] -> IList<A> conversion where B : A.
+
+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.
_______________________________________________
mono-bugs maillist  -  [email protected]
http://lists.ximian.com/mailman/listinfo/mono-bugs

Reply via email to