> On May 6, 2021, at 5:41 PM, Martin Frb via fpc-devel 
> <fpc-devel@lists.freepascal.org> wrote:
> 
> You can already cause ref circles, no classes needed.
> 
> type
>   TR = record
>     a: array of TR;
>   end;
> 
> var
>   x: TR;
> begin
>   SetLength(x.a,99);
>   x.a[0] := x;
> end.

This can be detected at compile and at least give a warning. "a" is a member of 
TR and the element type of "a" is TR, then we're assigning TR to said array. 
It's that simple I think.

Regards,
        Ryan Joseph

_______________________________________________
fpc-devel maillist  -  fpc-devel@lists.freepascal.org
https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-devel

Reply via email to