View Issue Details

IDProjectCategoryView StatusLast Update
0037380FPCCompilerpublic2020-07-17 10:27
Reporteravk Assigned To 
PrioritynormalSeverityminorReproducibilityalways
Status newResolutionopen 
Platformx86_64OSlinux 
Product Version3.2.0 
Summary0037380: Default value of the procedure/function parameter.
DescriptionThis example does not compile in delphi mode, but does compile successfully in objfpc mode.

program def_param;
{$mode delphi}
function GTest<T>(a: T; b: T = T(1)): T;
begin
  Result := a + b;
end;

function Foobar(a: Single; b: Single = Single(1)): Single;
begin
  Result := a + b;
end;

begin
  WriteLn(GTest<Single>(2, 1));
  WriteLn(Foobar(2));
end.

Current trunk compiles the example successfully in both modes.
TagsNo tags attached.
Fixed in Revision
FPCOldBugId
FPCTarget
Attached Files

Activities

There are no notes attached to this issue.

Issue History

Date Modified Username Field Change
2020-07-17 10:27 avk New Issue