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