fpc/tests/webtbs/tw34037.pp
florian eea088c5f5 * allow nil to be assigned to generic types, resolves #34037
* niln is also a constant node

git-svn-id: trunk@39934 -
2018-10-14 07:38:13 +00:00

22 lines
341 B
ObjectPascal

program project1;
{$mode objfpc}{$H+}
uses
Classes, FGL;
type
TBaseClass = class (TObject)
end;
generic TFPGObjectListEx<T: TBaseClass> = class (specialize TFPGObjectList<T>)
function GetItemByID(AID: Integer): T;
end;
function TFPGObjectListEx.GetItemByID(AID: Integer): T;
begin
Result:=nil; //T(nil);
end;
begin
end.