@@ -594,6 +594,7 @@ uses
if validparam then
begin
if tstoreddef(typeparam.resultdef).is_generic and
+ not is_or_belongs_to_current_genericdef(typeparam.resultdef) and
(
not parse_generic or
not defs_belong_to_same_generic(typeparam.resultdef,current_genericdef)
@@ -0,0 +1,21 @@
+{ %NORUN }
+
+program tgeneric117;
+{$mode delphi}
+type
+ TTest<T> = class
+ public type
+ TT = ^TTest<T>;
+ end;
+ TTest2<T> = class
+ TT2 = TTest2<T>;
+ TT = TTest<TT2>;
+begin
+end.
+{$mode objfpc}
+ generic TTest<T> = class
+ TT = ^specialize TTest<T>;
+ generic TTest2<T> = class
+ TT2 = specialize TTest2<T>;
+ TT = specialize TTest<TT2>;