[fpc-devel] Cannot Forward Declare a Generic Class

Den cyraid at gmail.com
Wed Aug 13 09:11:43 CEST 2014

Hi there,

     Is there a reason why I cannot forward declare a Generic Class?

TSomeClass<T> = Class;

TSomeOtherClass<T> = Class
   Obj : TSomeClass<T>;

TSomeClass<T> = Class


   Yes, I know I could put TSomeClass<T> inside TSomeOtherClass, but 
there are 2 other classes that back reference each other and it's quite 
the pain without being able to forward declare the Class.  Can this be 
implemented? I'm tired, so I may not be thinking of the implications of 
why.. I suppose I'll have to use some good ol' fashioned {$INCLUDE}'s 
inside the other class.

- Dennis Fehr

More information about the fpc-devel mailing list