Files
Marc VertesandGitHub c77dc1c4c5 interp: fix use of function as field of a recursive struct.
The logic of patching reflect struct representation has been fixed in presence of function fields and to better handle indirect recursivity (struct recursive through nested struct).

Fixes #1519.
2023-03-21 11:50:05 +01:00

17 lines
174 B
Go

package main
type F func(a *A)
type A struct {
Name string
F
}
func main() {
a := &A{"Test", func(a *A) { println("in f", a.Name) }}
a.F(a)
}
// Output:
// in f Test