Hi all,
I think i have found a bug in fpc. With the joined souce code, i have this strange output.
The first time, i have this output :
$ fpc -S2 -g -gl test.pp
/boot/home/config/bin/ppc386;-S2 -g -gl test.pp
Free Pascal Compiler version 1.0.7 [2003/03/29] for i386 Copyright (c) 1993-2003 by Florian Klaempfl
Target OS: BeOS for i386
Compiling test.pp
Compiling menu.pp
menu.pp(25,17) Warning: An inherited method is hidden by TMENU.CREATE Assembling menu
Compiling menubar.pp
Assembling menubar
Assembling test
Linking test
128 Lines compiled, 0.0 sec
$ test
Bonjour
TMenuBar.Create
function TMenu.AddItem(menu : TMenu) : boolean;
Now, i start a second compile (i keep *.o and *.ppu files)
$ fpc -S2 -g -gl test.pp
/boot/home/config/bin/ppc386;-S2 -g -gl test.pp
Free Pascal Compiler version 1.0.7 [2003/03/29] for i386 Copyright (c) 1993-2003 by Florian Klaempfl
Target OS: BeOS for i386
Compiling test.pp
Assembling test
Linking test
32 Lines compiled, 0.0 sec
$ test
Bonjour
TMenuBar.Create
function TMenu.AddItem(menu : TMenu; frame : TRect) : boolean;
There is several AddItem functions in TMenu, but with different parameters. The first time, the right function is called, but in the second case, the last AddItem function is called.
When AddItem functions are not virtual, the right function is always called.
I used the BeOS version of fpc.
