Incompatibility with Delphi in declaration of procedures with default params
Original Reporter info from Mantis: barlone @barloneD
-
Reporter name:
Original Reporter info from Mantis: barlone @barloneD
- Reporter name:
Description:
FPC permits such declaration:
-----------------------------------
interface
function PostMessage2MainWnd(Msg: cardinal; wParam: longint;
lParam: longint): boolean;
implementation
function PostMessage2MainWnd(Msg: cardinal; wParam: longint = 0;
lParam: longint = 0): boolean;
-----------------------------------
while I call PostMessage2MainWnd(1, 2, 3) was all good, but then I call
PostMessage2MainWnd(1, 2), compiler generate error:
"Wrong number of parameters specified for call to ...".
I spend many time to find cause of error in large unit - function was used only in implementation block and i forgot about it interface declaration.
Delphi (7) in this case not permits such declaration, and stops with error
"Declaration of 'PostMessage2MainWnd' differs from previous declaration".
I think it`s more correct.
Mantis conversion info:
- Mantis ID: 19434
- Build: from 2011/05/12
- Version: 2.5.1
- Fixed in version: 3.0.0
- Fixed in revision: 21524 (#50659b7e)
- Monitored by: » Basil Peace (Basil Peace), » alexvins (Alexander Shishkin)