Coming back to this presumed bug - I have not filed a bug report yet because I am uncertain. Up to now I thought that an advanced record would be initialized at runtime on the first access to any of its methods, simply by checking a flag. This would introduce a bit of overhead and speed penalty as the flag would have to be checked on each and every method call, but this may just be the price for the convenience.
But then I found, rather surprisingly, that aGen is initialized properly whenever a local function somewhere within testunit.pas merely mentions one of aGen's methods. The function may never be called, its existence alone is sufficient to prompt the compiler to initialize aGen. Something like this in the unit's implementation part does the job:
procedure neverused;
begin
if false then writeln (aGen.content);
end;
It looks like the compiler does a static analysis at compile time to guess if aGen will be called from somwehere, and if yes, initializes it at program start within fpc_initizalizeunits() ?