Hello, > But the following code also fails to compile, bug? > > package main > > type Int interface { > type int > } > > func Foo(type T Int) ([]T) {} // undefined: MyInt > > func main() { > type MyInt int > Foo([]MyInt(nil)) > }
It compiles if you move "type MyInt int" out of the func main scope. See https://go2goplay.golang.org/p/_sWi72-0rD1 Harald -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/golang-nuts/20200618121650.GA16023%40hweidner.de.