github.com/traefik/yaegi@v0.15.1/_test/type31.go (about)

     1  package main
     2  
     3  import "fmt"
     4  
     5  func (f Foo) Bar() int {
     6  	return f * f
     7  }
     8  
     9  type Foo = int
    10  
    11  func main() {
    12  	x := Foo(1)
    13  	fmt.Println(x.Bar())
    14  }
    15  
    16  // Error:
    17  // 5:1: cannot define new methods on non-local type int