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