Watch, Follow, &
Connect with Us
Public Report
Report From: Delphi Prism/IDE/Code Editor    [ Add a report in this area ]  
Report #:  79131   Status: Open
Can't enumerate sets
Project:  Embarcadero Prism Build #:  661?
Version:    1.1 Submitted By:   Eric Smith
Report Type:  Basic functionality failure Date Reported:  10/30/2009 7:24:33 PM
Severity:    Commonly encountered problem Last Updated: 3/20/2012 2:24:39 AM
Platform:    All platforms Internal Tracking #:   273549
Resolution: None (Resolution Comments) Resolved in Build: : None
Duplicate of:  None
Voting and Rating
Overall Rating: No Ratings Yet
0.00 out of 5
Total Votes: 1
Description
Existing Delphi 2006 allows you to enumerate the elements of a set using code similar to the following snippet.

var
  MySet: set of Element; {But see bug 73450}
  E: Element;

for E in MySet do
  DoStuff(E);


Prism complains that MySet does not implement IEnumerable, which is true but unhelpful.

Note that a suggested workaround of defining an IEnumerator/IEnumerable won't work because I can't do the following because bug 73450 prevents me from declaring a variable with type "set of T":

SetEnumerator<T> = public class(IEnumerator<T>)
private
  Elements: set of T;
etc...
Steps to Reproduce:
type
  Element = class
  end;
  ElementSet = set of Element;

var
  MySet: ElementSet;

for E: Element in MySet do
  DoStuff(E);
Workarounds
None.
Attachment
None
Comments

None

Server Response from: ETNACODE01