Reputation: 36654
The Free Pascal 2.6.2 compiler (using Delphi mode) complained about
program project16416258;
{$mode Delphi}
uses
Classes;
type
TFPCTestThread = class(TThread)
public
constructor Create(CreateSuspended: Boolean);
end;
constructor TFPCTestThread.Create(CreateSuspended: Boolean);
begin
inherited;
end;
begin
end.
with this error message:
ThroughputTestUnit.pas(82,19) Error: Wrong number of parameters
specified for call to "Create" Hint: Found declaration: constructor
TThread.Create(Boolean,const LongWord="4194304");
I fixed it using
inherited Create (CreateSuspended);
It seems to be caused by a change in 2.6.2, TThread has a constructor declaration with an optional second argument now:
constructor Create(CreateSuspended: Boolean;
const StackSize: SizeUInt = DefaultStackSize);
Upvotes: 2
Views: 743
Reputation: 1614
inherited;
calls base class constructor Create(CreateSuspended: Boolean)
. Since base class has no constructor which takes one boolean argument, you've got your error.
Upvotes: 3