fpc/tests/test/tgeneric73.pp
svenbarth a28a9a9521 * pdecobj.pas, object_dec:
Always define nested types of a generic as generic as well.
* symtable.pas: 
	+ Add a function which decides whether two defs belong to the same generic.
	* Fix sym_is_owned_by as there can be corner cases where childsym becomes Nil.
* ptype.pas:
	* record_dec: Always define nested types of a generic as generic as well.
	* single_type & read_named_type.expr_type:
		Use the newly added function to improve the checks whether a generic 
		symbol should be rejected as "generics not allowed for types of 
		variables or fields".
+ Add a test for which the improved checks are necessary.

git-svn-id: trunk@20189 -
2012-01-28 18:09:40 +00:00

23 lines
277 B
ObjectPascal

{ %NORUN }
{ This tests that nested types can reference each other inside a generic }
program tgeneric73;
{$mode objfpc}
type
generic TTest<T> = class
public type
TSubClass1 = class
end;
TSubClass2 = class
f: TSubClass1;
end;
end;
begin
end.