mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-04-07 15:47:53 +02:00

The main adjustments were as follows: - fixing coding style and identation - fixing some typos - using a better name for the property in tcallcandidates which holds the symbols created for anonymous parameter values
30 lines
479 B
ObjectPascal
30 lines
479 B
ObjectPascal
{%NORUN}
|
|
{$mode objfpc}
|
|
{$modeswitch implicitfunctionspecialization}
|
|
{$modeswitch advancedrecords}
|
|
{
|
|
Test generic record methods
|
|
}
|
|
|
|
program timpfuncspez8;
|
|
|
|
type
|
|
TMyRecord = record
|
|
generic class procedure Call<T>(msg: T); static;
|
|
generic procedure DoThis<T>(msg: T);
|
|
end;
|
|
|
|
generic class procedure TMyRecord.Call<T>(msg:T);
|
|
begin
|
|
end;
|
|
|
|
generic procedure TMyRecord.DoThis<T>(msg:T);
|
|
begin
|
|
end;
|
|
|
|
var
|
|
rec: TMyRecord;
|
|
begin
|
|
TMyRecord.Call('Hello World');
|
|
rec.DoThis(1);
|
|
end. |