[fpc-devel] Failure to recompile TAChart after FPC r40785 (committed by Jonas)
Sven Barth
pascaldragon at googlemail.com
Mon Jan 7 17:13:21 CET 2019
Am Mo., 7. Jan. 2019, 15:55 hat Werner Pamler <werner.pamler at freenet.de>
geschrieben:
> FPC trunk has not been very friendly to existing code recently...
>
> Today with r40792, the TAChart package fails to recompile:
> "tadiagram.pas(347,38) Error: Only static methods and static variables
> can be referenced through an object type". The faulty code is
>
> operator = (const A, B: TDiaPosition): Boolean;
> begin
> Result := TDiaPosition.Equals(A, B);
> end;
>
> where
>
> operator =(const A, B: TDiaPosition): Boolean; overload; inline;
>
> and
>
> type
> TDiaPosition = object
> public
> class function Equals(const A, B: TDiaPosition): Boolean;
> ...
>
> The last revision with which this line compiles is r40784. The next one,
> r40785, committed yesterday by Jonas ("give an error when trying to call
> an object instance method via a type node"), introduces the new issue.
>
> What can I do to revive the package?
>
Did you try to add "static" to the TDiaPosition.Equals class function? For
an object type only instance and static class methods make sense so non
static class methods should probably best be forbidden.
Regards,
Sven
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freepascal.org/pipermail/fpc-devel/attachments/20190107/ee3bbbee/attachment.html>
More information about the fpc-devel
mailing list