github.com/traefik/yaegi@v0.15.1/_test/struct41.go (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