History | Log In     View a printable version of the current page.  
Issue Details (XML | Word | Printable)

Key: BOO-24
Type: Improvement Improvement
Status: Resolved Resolved
Resolution: Fixed
Priority: Major Major
Assignee: Daniel Grunwald
Reporter: Rodrigo B. de Oliveira
Votes: 0
Watchers: 0
Operations

If you were logged in you would be able to see more operations.
Boo

for must call IDisposable.Dispose on enumerator whenever possible

Created: 14/Jul/04 10:41 PM   Updated: 23/Jan/08 07:00 AM
Component/s: Compiler
Affects Version/s: None
Fix Version/s: 0.8.1

Time Tracking:
Not Specified


 Description  « Hide
for item in enumerator:
pass

should be equivalent to:

try:
e=enumerator.GetEnumerator():
while e.MoveNext():
item = e.Current
ensure:
cast(IDisposable, e).Dispose() if e isa IDisposable



 All   Comments   Work Log   Change History      Sort Order: Ascending order - Click to sort in descending order
Rodrigo B. de Oliveira - 01/Oct/04 10:30 AM
This doesn't work well with generator methods since they are implemented using branch instructions and it's not possible to branch into a try block.

Daniel Grunwald - 23/Jan/08 07:00 AM
Implemented in revision 2833.