mirror of
https://github.com/hanzoai/yaegi.git
synced 2026-10-01 00:49:47 +00:00
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.
17 lines
174 B
Go
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
|