program tgeneric106; {$Mode Delphi} type G = class var X: T; // EXPECTED: gets compiled // ACTUAL: 'Error: Generics without specialization cannot be used as a type for a variable' class var F: function(const X: T) : G of object; function Foo(const X: T): G; end; function G.Foo(const X: T): G; begin result := G.Create; result.X := X end; begin G.F := G.Create.Foo; if G.F(42).X <> 42 then halt(1); end.