[fpc-devel] Allow record helper inheritance in Delphi mode

Sven Barth pascaldragon at googlemail.com
Tue Aug 29 15:46:52 CEST 2017


Am 29.08.2017 12:44 schrieb "Ondrej Pokorny" <lazarus at kluug.net>:
>
> On 29.08.2017 11:48, Sven Barth via fpc-devel wrote:
>>
>> The idea is okay as well, but I'd name it RecordHelperInheritance, cause
if we'd allow "type helper" in mode Delphi (as Maciej asks) then those
would support inheritance by default as they aren't Delphi compatible as a
whole anyway.
>
>
> Actually, IMO {$modeswitch typehelpers} should be supported in delphi
mode as well - just like {$modeswitch advancedrecords} is. Some code to
test:
>

It is supported and in fact also enabled by default, just not in the manner
you expect: it controls whether primitive types can be used with record
helpers in Delphi modes.

>
> Furthermore the record helper Delphi syntax is supported in ObjFPC mode -
even with inheritance [!]:

Of course it is, because the record (and class) helpers were implemented
first and I saw no reason to differentiate between class and record helpers
regarding inheritance. I merely differentiated between mode Delphi and the
others, because Delphi does not allow it.

Regards,
Sven
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freepascal.org/pipermail/fpc-devel/attachments/20170829/4fd20ff3/attachment.html>


More information about the fpc-devel mailing list