In some compiler modes, hidden overloaded method is accessible instead of one declared in unit interface section
Original Reporter info from Mantis: pcode@mail.ru
-
Reporter name: --
Original Reporter info from Mantis: pcode@mail.ru
- Reporter name: --
Description:
- -l -Mobjfpc -Sh -Fcutf8 -gl main -B => no error is reported
- -l -Mobjfpc -Sh -Fcutf8 -gl main => wrong number of parameters (as expected)
Moreover, in 1st case "wrong number of parameters" could be reported for correct call (no example, sorry).
Steps to reproduce:
Additional information:
program main;
{$ifdef FPC}{$mode objfpc}{$h+}{$endif}
uses bugunit;
begin
proc( 1, 2 ); // no error with -B compiler flag
end.
unit bugunit;
{$ifdef FPC}{$mode objfpc}{$h+}{$endif}
interface
procedure proc( arg1: longint );
implementation
procedure proc( arg1: longint );
begin
end;
procedure proc( arg1, arg2: longint );
begin
end;
end.
Mantis conversion info:
- Mantis ID: 25283
- Fixed in version: 3.1.1
- Fixed in revision: 35309 (#048666a2)