mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-04-05 08:38:14 +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
452 B
ObjectPascal
30 lines
452 B
ObjectPascal
{%NORUN}
|
|
{$mode objfpc}
|
|
{$modeswitch implicitfunctionspecialization}
|
|
{
|
|
Test generic methods
|
|
}
|
|
|
|
program timpfuncspez7;
|
|
|
|
type
|
|
TMyClass = class
|
|
generic class procedure Call<T>(msg: T);
|
|
generic procedure DoThis<T>(msg: T);
|
|
end;
|
|
|
|
generic class procedure TMyClass.Call<T>(msg:T);
|
|
begin
|
|
end;
|
|
|
|
generic procedure TMyClass.DoThis<T>(msg:T);
|
|
begin
|
|
end;
|
|
|
|
var
|
|
obj:TMyClass;
|
|
begin
|
|
TMyClass.Call('Hello World');
|
|
obj := TMyClass.create;
|
|
obj.DoThis(1);
|
|
end. |