github.com/gnolang/gno@v0.0.0-20240520182011-228e9d0192ce/gnovm/tests/files/interface12.gno (about)

     1  package main
     2  
     3  type I1 interface {
     4  	Truc()
     5  }
     6  
     7  type T1 struct{}
     8  
     9  func (T1) Truc() { println("in T1 truc") }
    10  
    11  var x I1 = T1{}
    12  
    13  func main() {
    14  	x.Truc()
    15  }
    16  
    17  // Output:
    18  // in T1 truc