See https://go.dev/ref/spec#Type_definitions and https://go.dev/ref/spec#Type_identity. In particular this statement: "The new type is called a *defined type*. It is different <https://go.dev/ref/spec#Type_identity> from any other type, including the type it is created from."
On Sat, Jun 3, 2023 at 5:03 PM Duncan Harris <dun...@harris3.org> wrote: > Why does this not work? > > https://go.dev/play/p/dodUj441xJS > > Produces the rather strange error message: > > ./prog.go:7:6: cannot use []t{…} (value of type []struct{f string}) as > []struct{f string} value in argument to m.F > > -- > 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/396c63a7-4b0c-4f5e-8c0e-a1e45249e247n%40googlegroups.com > <https://groups.google.com/d/msgid/golang-nuts/396c63a7-4b0c-4f5e-8c0e-a1e45249e247n%40googlegroups.com?utm_medium=email&utm_source=footer> > . > -- Kurtis Rader Caretaker of the exceptional canines Junior and Hank -- 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/CABx2%3DD8xgRUXQxOpzTuubqMg%3DN_m98VMUHGJUhXF4hMNqA8taQ%40mail.gmail.com.