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

Maciej Izak hnb.code at gmail.com
Tue Aug 29 21:50:44 CEST 2017


2017-08-29 20:24 GMT+02:00 Ondrej Pokorny <lazarus at kluug.net>:

> No - please not yet another undefined behavior :)
>
> It's perfectly defined: disabled without typehelpers, enabled with
> typehelpers.
>

but in the case of strictly defined rules we must to do as Sven said:

 "Namely that it enabled the "type helper" syntax including the
inheritance. But the record helpers are left as is..."

it is contrary to your previous message:

+ It means that record helper inheritance will be enabled with typehelpers
> as well because if I am not mistaken currently the compiler cannot
> distinguish between a type helper and record helper acting on a record.
> (IMO it is even a plus.)
>

in "Svens scenario" inheritance for "record helper" should be blocked in
Delphi mode and compiler is obligated to knows differences between "type
helper" and "record helper".

By "undefined behavior" I mean allowing inheritance for "record helper" in
Delphi mode *for now* because is not harmful (especially with switch
typehelpers). "for now" means years or even forever.

If you wish to have strictly defined rules for "record helpers" inheritance
in Delphi mode it simple means no inheritance for such case as is in Delphi
:)

-- 
Best regards,
Maciej Izak
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freepascal.org/pipermail/fpc-devel/attachments/20170829/daddfef8/attachment.html>


More information about the fpc-devel mailing list