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

Ondrej Pokorny lazarus at kluug.net
Tue Aug 29 22:09:33 CEST 2017


On 29.08.2017 21:50, Maciej Izak wrote:
> 2017-08-29 20:24 GMT+02:00 Ondrej Pokorny <lazarus at kluug.net 
> <mailto: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..."

Why? I can make strictly defined rules that typehelpers also allow 
record helper inheritance. There are no limitations for definitions ;)

> 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".

I, on the contrary, read:

On 29.08.2017 18:54, Sven Barth via fpc-devel wrote:
 > (btw: a type helper for a primitive type can inherit from a record 
helper of the same type, internally they're all the same)

Btw. record helpers support inheritance in all modes but Delphi. It 
doesn't make sense to disallow it for record helpers but allow it for 
type helpers... Too overcomplicated without any plus value :/

Ondrej
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freepascal.org/pipermail/fpc-devel/attachments/20170829/2ff6cb7a/attachment.html>


More information about the fpc-devel mailing list