[Mono-bugs] [Bug 40176][Nor] Changed - Error with implicit casts in foreach statement

bugzilla-daemon@rocky.ximian.com bugzilla-daemon@rocky.ximian.com
Tue, 25 Mar 2003 07:08:34 -0500 (EST)


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 lupus@ximian.com.

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

--- shadow/40176	Sun Mar 23 18:22:15 2003
+++ shadow/40176.tmp.6048	Tue Mar 25 07:08:34 2003
@@ -1,23 +1,23 @@
 Bug#: 40176
 Product: Mono/MCS
 Version: unspecified
-OS: 
+OS: unknown
 OS Details: 
 Status: NEW   
 Resolution: 
-Severity: 
+Severity: Unknown
 Priority: Normal
 Component: Misc
 AssignedTo: mono-bugs@ximian.com                            
 ReportedBy: yoros@wanadoo.es               
 QAContact: mono-bugs@ximian.com
 TargetMilestone: ---
 URL: 
 Cc: 
-Summary: Error compiling foreach statement
+Summary: Error with implicit casts in foreach statement
 
 When using foreach to iterate a Double array and we use something like this:
 
     foreach (float f in doubles) { ... }
 
 the values assigned to f are all wrong.
@@ -26,6 +26,15 @@
 CSC works on mono and ms.net.
 
 ------- Additional Comments From yoros@wanadoo.es  2003-03-23 18:22 -------
 Created an attachment (id=3781)
 Sample code that fails in mono and works in ms.net
 
+
+------- Additional Comments From lupus@ximian.com  2003-03-25 07:08 -------
+PEVerify gives the following error:
+[IL]: Error: [d:\cstests\foreach-double.exe :
+DoubleToFloatForeach::Main] [offset 0x0000005D] [opcode ldelem.r4]
+[found array class System.Double[]] [expected array class
+System.Single[]] Unexpected type on the stack.
+Note that the issue may be there also for other combinations of types
+(of the array and of the foreach variable).