[fpc-pascal] Traits Proposal

Sven Barth pascaldragon at googlemail.com
Fri Feb 19 23:14:15 CET 2021


Am 19.02.2021 um 20:37 schrieb Ryan Joseph via fpc-pascal:
>
>> On Feb 19, 2021, at 11:01 AM, Sven Barth via fpc-pascal <fpc-pascal at lists.freepascal.org> wrote:
>>
>> Your example is not quite correct and it's also not really complete: if a class implements an interface there *must* be a parent class mentioned (at least TObject). Also your example should demonstrate that one can call TMyShape.Draw without having to retrieve the interface (after all that's the point of the interface property).
>>
> TObject is always the root class I thought? Why is it different here?

TObject *is* always the root, but the first entry of the inheritance 
list of a class *must* be a class as well.

>> Additionally support for raw interfaces (aka Corba) should be added for interface delegation if it isn't already supported. (Otherwise your TMyShape either needs to inherit from e.g. TInterfacedObject or one of the involved types needs to implement the methods of IInterface.
>>
> They work already fortunately.

Good. :)

Regards,
Sven


More information about the fpc-pascal mailing list