You can declare multiple helpers for a class, the compiler will simply pick the last one in scope. If you want to use multiple helpers you need to use inheritance.
Also the compiler would not be able to detect that you extend class A (declared in unit A) in both units B and C (without dependencies on eachother) as those units could be compiled independently (or be precompiled), not to mention that you could use unit B in unit X and unit C in Y those using different helpers for A inside the same binary.
Please note that we're planning to add support for multiple helpers to be active at once. You can keep track of the progress here.
Thanks for those Sven. I'd picked up the dependencies issue but in this case both helpers were in the same unit which is why I was wondering whether there was a "one helper per unit" rule or something similar.
>> The second: Can the definition of a class list the names of the units in which it may be extended by a helper?
>
> Eh? What are you asking here?
Whether at the time of definition a class can have restrictions as to where helpers can be declared, e.g. that helpers for TObject can only be in known RTL units.
In practice I think that the existing dependency rules probably go a long way towards that, but I think that whether a chain of helpers can be sealed is still a fair question- and probably one that needs to be considered before any relaxation of the structure.
MarkMLl