mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-04-07 17:47:56 +02:00
28 lines
281 B
ObjectPascal
28 lines
281 B
ObjectPascal
unit ugeneric14;
|
|
|
|
{$mode objfpc}
|
|
|
|
interface
|
|
|
|
type
|
|
generic TGTest<T> = class
|
|
public
|
|
data: T;
|
|
procedure DoSomething;
|
|
end;
|
|
|
|
implementation
|
|
|
|
function Foo: Integer;
|
|
begin
|
|
writeln('foo');
|
|
Result := 1;
|
|
end;
|
|
|
|
procedure TGTest.DoSomething;
|
|
begin
|
|
data := Foo;
|
|
end;
|
|
|
|
end.
|