github.com/traefik/yaegi@v0.15.1/_test/issue-1404.go (about) 1 package main 2 3 type I interface { 4 inI() 5 } 6 7 type T struct { 8 name string 9 } 10 11 func (t *T) inI() {} 12 13 func main() { 14 var i I = &T{name: "foo"} 15 16 if i, ok := i.(*T); ok { 17 println(i.name) 18 } 19 } 20 21 // Output: 22 // foo