On Fri, Nov 12, 2021 at 9:23 AM 'Axel Wagner' via golang-nuts <golang-nuts@googlegroups.com> wrote: > > On Fri, Nov 12, 2021 at 6:20 PM tapi...@gmail.com <tapir....@gmail.com> wrote: >> >> How much complicated? Is it similar to >> >> func foo(int int) {} > > > No. As I said, the situation is different, as type-parameters must be able to > be self- and mutually referential.
The scope of regular parameters starts at the beginning of the function body (https://golang.org/ref/spec#Declarations_and_scope, rule 4 in the list of rules). The scope of a type parameter starts at the beginning of the type parameter list (https://go.googlesource.com/proposal/+/refs/heads/master/design/43651-type-parameters.md#mutually-referencing-type-parameters). Ian -- 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/CAOyqgcX95qRPFJ9B8js%3D50iYwqrynCTU0%2BW%2B2LNnJUtjVC81fw%40mail.gmail.com.