How do I check or change which set elements are present, using RTTI? I want to be able to check, add and remove T:TElements from ST:TElementSet.
type
TElements = (elA, elB, elC);
TElementSet = set of TElements;
TMyClass = class
property SetValue:ST;
end;
Generics doesn’t enable me to tell the compiler that T is an enumerated type and that ST is a set of T.
RTTI enables me to identify the types as tkEnumeration and tkSet – but I am unsure if I can make a strict connection between the two using RTTI. That doesn’t really matter as I only need to twiddle the set bits by ordinal value.
The question is: Can I do this safely, using Generics and RTTI, and if so – how?
Examples and/or references to prior art would be appreciated.

Some days I really miss C++…
It must be possible. Perhaps it is buried somewhere in the designer code?
I think you have to do it yourself with knowledge of the implementation
Posted a dog slow but hopefully safe solution on SO.
Asbjørn Heid The “tests” are funny as they don’t test anything than that it does not raise an exception
Stefan Glienke Huh? The first two tests succeed (which they should) and the last three tests fail (which they should). At least on my end, with D10.
Asbjørn Heid Yes, after your edit ;p
Stefan Glienke None of my edits changed the core code, at least before I pasted it on SO… 🙂