[Pas2js] My 1st type helper

Sven Barth pascaldragon at googlemail.com
Sat Mar 2 10:34:37 CET 2019


Am 02.03.2019 um 00:44 schrieb Mattias Gaertner via Pas2js:
> On Fri, 1 Mar 2019 22:48:29 +0100
> Sven Barth via Pas2js <pas2js at lists.freepascal.org> wrote:
>
>> [...]
>> Also FPC 3.2 supports helpers for interfaces. ;)
> Impressive!
Thanks :)
> I only found one test "test/tthlp24.pp", which only tests
> methods and class methods.
>
> What about constructors?
>
> Constructors create a fatal error:
>
> type
>    ITestIntf = interface(IUnknown)
>    end;
>
>    THelper = type helper for ITestIntf
>      constructor Create(s: string);
>    end;
>
>    TTest = class(TInterfacedObject, ITestIntf)
>    end;
>
> constructor THelper.Create(s: string);
> begin  // Fatal: Internal error 200305103
>    writeln('THelper.Create ',s);
> end;
I personally wouldn't consider constructors a good/useful idea for 
interfaces. Though they shouldn't result in an internal error either... :/

Regards,
Sven


More information about the Pas2js mailing list