[Mono-bugs] [Bug 80260][Nor] Changed - [GMCS] Can't convert IList<T> to T array

bugzilla-daemon at bugzilla.ximian.com bugzilla-daemon at bugzilla.ximian.com
Mon Dec 18 19:17:41 EST 2006


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 miguel at ximian.com.

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

--- shadow/80260	2006-12-14 10:07:01.000000000 -0500
+++ shadow/80260.tmp.2865	2006-12-18 19:17:41.000000000 -0500
@@ -1,15 +1,15 @@
 Bug#: 80260
 Product: Mono: Compilers
 Version: 1.2
-OS: 
+OS: unknown
 OS Details: Linux dapper 2.6.15-26-k7
 Status: NEW   
 Resolution: 
-Severity: 
-Priority: Wishlist
+Severity: Unknown
+Priority: Normal
 Component: C#
 AssignedTo: rharinath at novell.com                            
 ReportedBy: rodrigobamboo at gmail.com               
 QAContact: mono-bugs at ximian.com
 TargetMilestone: ---
 URL: 
@@ -35,6 +35,27 @@
 CantCastGenericListToArray.cs(8,34): error CS0030: Cannot convert type
 `System.Collections.Generic.IList<string>' to `string[]'
 Compilation failed: 1 error(s), 0 warnings
 
 Expected Results:
 Successful compilation.
+
+------- Additional Comments From miguel at ximian.com  2006-12-18 19:17 -------
+Per a discussion with Martin, these are just a few cases missing in
+ExplicitReferenceConversionExists and ExplicitReferenceConversion in
+mcs/convert.cs
+
+The relevant piece of the spec that is missing is: 13.2.3 "Explicit
+Reference Conversions" is missing the last two conversions that only
+apply to the generics compiler.  These are:
+
+"* From a one-dimensional array-type S[] to
+System.Collections.Generic.IList<T> and its base
+interfaces, provided there is an explicit reference conversion from S
+to T.
+* From System.Collections.Generic.IList<T> and its base interfaces to
+a one-dimensional"
+array-type S[], provided there is an implicit or explicit reference
+conversion from S[] to
+System.Collections.Generic.IList<T>. This is precisely when either S
+and T are the same type
+or there is an implicit or explicit reference conversion from S to T.


More information about the mono-bugs mailing list