compiler: support all kinds of recursive types

Previously we only supported recursive types in structs. But there can
be other kinds of recursive types, like slices:

    type RecursiveSlice []RecursiveSlice

This doesn't involve structs, so it led to infinite recursion in the
compiler. This fix avoids recursion at the proper level: at the place
where the named type is defined.
This commit is contained in:
Ayke van Laethem
2023-03-16 23:48:50 +01:00
committed by Ron Evans
parent c5598630c9
commit 5b42871baa
3 changed files with 17 additions and 9 deletions
+1
View File
@@ -16,3 +16,4 @@ bytes: len=6 cap=6 data: 1 2 3 102 111 111
slice to array pointer: 1 -2 20 4
unsafe.Add array: 1 5 8 4
unsafe.Slice array: 3 3 9 15 4
len: 0