Unit code:
unit TestUnit;
interface
type
DataT = record
field: integer; // causes failure when referenced within «initialization»
end;
var
data: DataT;
procedure InitializeData();
implementation
procedure InitializeData();
begin
data.field := 6;
end;
initialization
begin
InitializeData(); // comment to get rid of the failure and let the user to call this procedure manually
end;
end.
Program code:
uses TestUnit;
begin
end.
Exception thrown at runtime: 
Unit code:
Program code:
Exception thrown at runtime: