[Mono-bugs] [Bug 385503] Compiler generated enumerator fails when iterating over empty list

bugzilla_noreply at novell.com bugzilla_noreply at novell.com
Mon May 5 22:25:43 EDT 2008


User harinath at hurrynot.org added comment

Raja Harinath <harinath at hurrynot.org> changed:

           What    |Removed                                         |Added
                 CC|                                                |harinath at hurrynot.org
         AssignedTo|mono-bugs at lists.ximian.com                      |harinath at hurrynot.org
             Status|NEW                                             |ASSIGNED

--- Comment #1 from Raja Harinath <harinath at hurrynot.org>  2008-05-05 20:25:43 MST ---
According to the standard:

  When an enumerator object is in the before, running, or after states, the 
  result of accessing Current is unspecified.

The enumerator is in the 'after' state in your example.

The gmcs implementation matches the behaviour of enumerators in the BCL. 
However, it does appear from the (non-normative) examples in the standard and
from the behaviour of csc that we don't need to be that draconian :-)

Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the QA contact for the bug.
You are the assignee for the bug.

More information about the mono-bugs mailing list