I created a simple set (enum):
Type
SSet = (
sOne,
sTwo,
sThree,
sFour
);
TSet = set of SSet;
Then I wrote a test. The code snippet below works fine unless I remove the “: TSet” declaration. This is inconsistent since the [SSet.sThree] indicates a set (), so the type shouldn’t need stating.
var s1: TSet := [SSet.sThree];
var s2 := [SSet.sOne, SSet.sThree];
var ix := s1 * s2;
Omitting it throws:
Error 1 (E64) Type mismatch, cannot find operator to evaluate “array of SSet” * “array of SSet” …
Further, ix is invisible to IntelliSence. The following compiles correctly, but I had to escape IntelliSence and manually type ix:
if (SSet.sThree in ix) then
MessageBox.Show('OK');