From documentation:
If the overload keyword is not present, then all overloaded versions
must reside in the same unit, and if it concerns methods part of a
class, they must be in the same class, i. e. the compiler will not look
for overloaded methods in parent classes if the overload keyword w
07.02.2025 22:27, Michał Gawrycki пишет:
From documentation:
If the overload keyword is not present, then all overloaded versions
must reside in the same unit, and if it concerns methods part of a
class, they must be in the same class, i. e. the compiler will not
look for overloaded methods i
On Fri, Feb 7, 2025 at 5:39 PM Bart wrote:
> D7 refuses to compile this code (even with "overload"), but D7 is a
> little bit old...
Well, Delphi is a bit picky about the order: it must be "overload;
virual;" (I had "virual; overload;")
So, with that fixed, D7 compiles the code as well.
--
Ba
On Fri, Feb 7, 2025 at 2:40 PM Maxim Ganetsky via fpc-devel
wrote:
It compiles if you declare the methods in TBase as "overload".
D7 refuses to compile this code (even with "overload"), but D7 is a
little bit old...
--
Bart
___
fpc-devel maillist -
Hello.
The following program does not compile, because overloaded AddItem(s:
string) method in ancestor is not visible from child class. Is it normal?
program Test;
{$MODE OBJFPC}
type
TBase = class
public
procedure AddItem(s: string; i: integer); virtual;
procedure AddItem(s: stri