[Mono-bugs] [Bug 51446][Maj] New - MCS produces bad code for foreach keyword

bugzilla-daemon@bugzilla.ximian.com bugzilla-daemon@bugzilla.ximian.com
Thu, 27 Nov 2003 13:21:24 -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 m.canini@libero.it.

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

--- shadow/51446	2003-11-27 13:21:24.000000000 -0500
+++ shadow/51446.tmp.28245	2003-11-27 13:21:24.000000000 -0500
@@ -0,0 +1,45 @@
+Bug#: 51446
+Product: Mono/MCS
+Version: unspecified
+OS: 
+OS Details: 
+Status: NEW   
+Resolution: 
+Severity: 
+Priority: Major
+Component: Misc
+AssignedTo: mono-bugs@ximian.com                            
+ReportedBy: m.canini@libero.it               
+QAContact: mono-bugs@ximian.com
+TargetMilestone: ---
+URL: 
+Summary: MCS produces bad code for foreach keyword
+
+Description of Problem:
+The attached code compiled with mcs produces different effects than MS .Net
+ and DotGNU Portable.Net
+I was unable to reproduce the effects i get in my app: a invalid cast
+exception.
+However the test case is able to show you that the code compiled with mcs
+calls a different overloaded version of Current method of my enumerator.
+
+Steps to reproduce the problem:
+1. Compile the code with mcs
+2. Compile the code with csc
+
+Actual Results:
+object IEnumerator.Current()
+Foo name: Second
+object IEnumerator.Current()
+Foo name: First
+
+Expected Results:
+Foo Current()
+Foo name: Second
+Foo Current()
+Foo name: First
+
+How often does this happen? 
+Always
+
+Additional Information: