fix types named recursive

This commit is contained in:
visualfc
2024-05-11 12:03:02 +08:00
parent 2589c23998
commit 92827a1f04
5 changed files with 201 additions and 6 deletions

39
cl/_testrt/named/in.go Normal file
View File

@@ -0,0 +1,39 @@
package main
import "github.com/goplus/llgo/internal/runtime/c"
type mSpanList struct {
first *mspan
last *mspan
}
type minfo struct {
span *mspan
info int
}
type mspan struct {
next *mspan
prev *mspan
list *mSpanList
info minfo
value int
check func(int) int
}
func main() {
m := &mspan{}
m.value = 100
m.next = &mspan{}
m.next.value = 200
m.list = &mSpanList{}
m.list.last = &mspan{}
m.list.last.value = 300
m.info.info = 10
m.info.span = m
m.check = func(n int) int {
return m.value * n
}
c.Printf(c.Str("%d %d %d %d %d %d\n"), m.next.value, m.list.last.value, m.info.info,
m.info.span.value, m.check(-2), m.info.span.check(-3))
}