View Issue Details

IDProjectCategoryView StatusLast Update
0019434FPCCompilerpublic2012-06-08 09:43
Reporterbarlone Assigned ToJonas Maebe  
PrioritynormalSeverityminorReproducibilityalways
Status closedResolutionfixed 
Product Version2.5.1 
Fixed in Version3.0.0 
Summary0019434: Incompatibility with Delphi in declaration of procedures with default params
DescriptionFPC 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.

TagsNo tags attached.
Fixed in Revision21524
FPCOldBugId
FPCTarget
Attached Files

Relationships

related to 0017136 resolvedJonas Maebe Overridden abstract methods with changed default parameters 

Activities

2011-05-27 18:21

 

test1.lpr (78 bytes)

2011-05-27 18:21

 

unit1.pas (354 bytes)

barlone

2012-06-08 09:43

reporter   ~0060367

Thanks

Issue History

Date Modified Username Field Change
2011-05-27 14:41 barlone New Issue
2011-05-27 18:21 barlone File Added: test1.lpr
2011-05-27 18:21 barlone File Added: unit1.pas
2012-05-20 17:42 Jonas Maebe Relationship added related to 0017136
2012-06-08 00:39 Jonas Maebe Fixed in Revision => 21524
2012-06-08 00:39 Jonas Maebe Status new => resolved
2012-06-08 00:39 Jonas Maebe Fixed in Version => 2.7.1
2012-06-08 00:39 Jonas Maebe Resolution open => fixed
2012-06-08 00:39 Jonas Maebe Assigned To => Jonas Maebe
2012-06-08 09:43 barlone Status resolved => closed
2012-06-08 09:43 barlone Note Added: 0060367