github.com/gnolang/gno@v0.0.0-20240520182011-228e9d0192ce/gnovm/tests/files/struct41.gno (about) 1 package main 2 3 type Ti func(*T) 4 5 type T1 struct { 6 t Ti 7 } 8 9 type T struct { 10 t Ti 11 y *xxx 12 } 13 14 func f(t *T) { println("in f") } 15 16 type xxx struct{} 17 18 var x = &T1{t: f} 19 20 func main() { 21 x.t = f 22 println("ok") 23 } 24 25 // Output: 26 // ok