mirror of
https://github.com/tinygo-org/tinygo.git
synced 2026-08-12 15:03:41 +00:00
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:
committed by
Ron Evans
parent
c5598630c9
commit
5b42871baa
Vendored
+1
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user