Bug 318907 (MONO76009) - Using yield produces classes with duplicate field names.
Summary: Using yield produces classes with duplicate field names.
Status: RESOLVED MOVED
Alias: MONO76009
Product: Mono: Compilers
Classification: Mono
Component: C# (show other bugs)
Version: unspecified
Hardware: Other All
: P3 - Medium : Enhancement
Target Milestone: ---
Assignee: Raja R Harinath
QA Contact: Mono Bugs
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2005-09-07 15:48 UTC by Eyal Alaluf
Modified: 2007-09-15 21:24 UTC (History)
0 users

See Also:
Found By: ---
Services Priority:
Business Priority:
Blocker: ---
Marketing QA Status: ---
IT Deployment: ---


Attachments
C# test sample (332 bytes, text/plain)
2005-09-07 15:51 UTC, Thomas Wiest
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Thomas Wiest 2007-09-15 19:29:39 UTC


---- Reported by eyala@mainsoft.com 2005-09-07 08:48:22 MST ----

When using the new C# 20 keyword yield in an IEnumerable fields with 
duplicate names are created within the auto-generated yield class if local 
variables using the same name are defined in several places within the 
method.
It appears that the algorithm simply adds a field for every local variable 
using the local variable name. If a name is used for a local variable more 
then once then several fields using the same name will be created.
Using the attached program, once compiled into a DLL you can see using 
ildasm that '<ff>__' has two fields call 'i'. Trying to ilasm the code 
generated by ildasm will fail.



---- Additional Comments From eyala@mainsoft.com 2005-09-07 08:51:16 MST ----

Created an attachment (id=168473)
C# test sample




---- Additional Comments From jankit@novell.com 2005-09-12 00:45:18 MST ----



*** This bug has been marked as a duplicate of https://bugzilla.novell.com/show_bug.cgi?id=MONO75934 ***

Imported an attachment (id=168473)

This bug was marked DUPLICATE in the database it was moved from.
    Changing resolution to "MOVED"