What's the concern with "a constant interface that is inhabited exactly by the types that can compare to nil?"
This is clearly something the language has as a concept -- it knows whether "foo == nil" is an error or not. "nil" could be the ergonomic name for this constraint: func Compact[T nil](s []T) ... Sincerely, Jon On Mon, Oct 2, 2023, 16:53 Ian Lance Taylor <i...@golang.org> wrote: > There is a lot more on this topic at https://go.dev/issue/61372. > We're not sure how best to handle it. > > 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/CAJgyHGPRdv%3DjOPs34V1Q%3DNh9RVpD8c-qagr%3DdEz0OX-oDEaa7Q%40mail.gmail.com.