[fpc-devel] Re: [fpc-announce] Feature announcement: Type helpers

Sven Barth pascaldragon at googlemail.com
Fri Feb 8 07:03:18 CET 2013


Am 08.02.2013 02:03 schrieb "Gerhard Scholz" <gs at g--s.de>:
>
> Hello,
>
> I tried to compile the example:
>
>
> type
>   TLongIntHelper = type helper for LongInt
>     class procedure Test; static;
>   end;
>
> class procedure TLongIntHelper.Test;
> begin
>   Writeln('Test');
> end;
>
> var
>   i: LongInt;
> begin
>   i.Test;
>   $12345678.Test;
>   LongInt.Test;
> end.
>
> Result:
>
> 0:25:46,51 G:\ob\syncdirs>ppc386 -vv -al -CioOrt -Cs6000000  -gclt
-Mobjfpc -O1 -OpPENTIUM -Fuu:\ -FuM:\u -FuC:\c\-u -FiC:\c\-u -Fuz:\-u
-Fiz:\-u -FuP:\gs\tp55\includes -Fuf:\-u -Fiu:\ -FiM:\u
-FiP:\gs\tp55\includes -Fif:\-u -FE. thelper
> thelper.pas(2,33) Error: Identifier not found "helper"
> thelper.pas(2,33) Error: Error in type definition
> thelper.pas(2,33) Error: Can't create unique type from this type
> thelper.pas(2,33) Fatal: Syntax error, ";" expected but "FOR" found
> Fatal: Compilation aborted
>
> The compiler is freshly generated from the SVN
>
> Does the compiler expect special options to invoke the record helper
feature?

Did you add "{$mode objfpc}" to your program?

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


More information about the fpc-devel mailing list