Re: [fpc-devel] Visibility of overloaded ancestor method from a child class

2025-02-07 Thread Maxim Ganetsky via fpc-devel
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

[fpc-devel] Visibility of overloaded ancestor method from a child class

2025-02-07 Thread Maxim Ganetsky via fpc-devel
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

Re: [fpc-devel] Visibility of overloaded ancestor method from a child class

2025-02-07 Thread Bart via fpc-devel
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 -

Re: [fpc-devel] Visibility of overloaded ancestor method from a child class

2025-02-07 Thread Bart via fpc-devel
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