<!DOCTYPE html>
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
</head>
<body>
Hi,<br>
<br>
I have a use-case where I needed to forward declare some records.
<br>
The FPC <a
href="https://www.freepascal.org/docs-html/ref/refse16.html">documentation</a>
says "Note that a forward type declaration is only possible with
pointer types and classes, not with other
types".<br>
<br>
I wonder why? Is there any technical difference between classes
and records for the purpose of forward declaration?<br>
<br>
My use-case was to define a few records like the following:<br>
<br>
type<br>
TData = record<br>
....<br>
function ToA: TA;<br>
end;<br>
<br>
TA = record<br>
Data: TData;<br>
....<br>
end;<br>
<br>
I know I can define classes instead of record, but I do not want to
do so, since I need to "Free" the objects. <br>
<br>
Amir<br>
</body>
</html>