Hello.
In source code there are many cases when error 'illegal recursion in type' may appear.
Can you get some common rules how to decide that cases? Is there any documentation about this type of errors?
That means one of your types contains instances of another, that contains the first one. They just cannot contain each other infinitely.
The easiest way to get it:
type
T1 = object
x: T2
T2 = object
x: T1
But this will work:
type
T1 = object
x: T2
T2 = object
x: ref T1
ref is just a pointer, instances of T1 are not inside of instances of T2.
And probably minimal code to get this error:
type
T = object
x: T