[Pas2js] My 1st type helper

Sven Barth pascaldragon at googlemail.com
Fri Mar 1 22:48:29 CET 2019


Am 28.02.2019 um 21:13 schrieb Mattias Gaertner via Pas2js:
> On Thu, 28 Feb 2019 19:47:15 +0100
> Sven Barth via Pas2js <pas2js at lists.freepascal.org> wrote:
>
>> Am 27.02.2019 um 14:07 schrieb warleyalex via Pas2js:
>>> this syntax
>>> //  TFloatHelper  =  helper for Float
>>>
>>> // hum, doesn't work for me, I had to include the keyword type
>> Correct, because they're *type* helpers. To have them distinct from
>> "class helper" and "record helper" (though FPC allows nearly any type
>> nowadays for type helpers, don't know if pas2js followed that).
> pas2js requires class helpers for classes and external classes.
> type helpers can extend records, simple types, range types, array types,
> enum types, set types.
> For example you cannot extend helpers, interfaces, pointer types or
> procedure types.
FPC allows "type helper" for all the types supported by helpers.
Also FPC 3.2 supports helpers for interfaces. ;)

Regards,
Sven


More information about the Pas2js mailing list