On Wed, Jan 18, 2023 at 8:08 PM Andrew Athan <andrew...@gmail.com> wrote: > > The remaining issue is that, irrespective of the "wideness" of the "any" type > constraint, which apparently includes non-comparable types, the resolution of > v's type is to a comparable type, yet the error is still emitted.
The body of the generic function is required to compile for any type that satisfies the constraint. That means that the compilation of a generic function is independent of the actual type argument used to instantiate it. This is explained at https://go.googlesource.com/proposal/+/refs/heads/master/design/43651-type-parameters.md#constraints . 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/CAOyqgcXROm8USypmS4bgeq5OQFLwFHGzmvnQ2g-sZCb3U-6LcQ%40mail.gmail.com.