On Fri, 21 Aug 2020 at 18:30, Axel Wagner <axel.wagner...@googlemail.com> wrote:
> My one concern with making it an alias is error messages. > If the source code says "any", I think so should the error messages. > Currently, the compiler forgets aliases too early > <https://play.golang.org/p/m8o9JiOyy9z>. > I agree that's a concern, but I think that should be a reason to fix error messages when aliases are used, not to use a named type. > On Fri, Aug 21, 2020 at 7:08 PM roger peppe <rogpe...@gmail.com> wrote: > >> >> >> On Fri, 21 Aug 2020 at 15:24, Ian Lance Taylor <i...@golang.org> wrote: >> >>> On Fri, Aug 21, 2020, 12:37 AM 'Axel Wagner' via golang-nuts < >>> golang-nuts@googlegroups.com> wrote: >>> >>>> Just to clarify, the intent is to make the declaration in the spec >>>> `type any = interface{}`, not `type any interface{}`, correct? The latter >>>> would be more analogous to `error`. Either has certain advantages and >>>> disadvantages, I'm not sure which I prefer, but I just want to make sure I >>>> understand the plan :) >>>> >>> >>> I've been thinking of a type alias rather than a defined type, but I'm >>> not sure which is best. It would be interesting to hear whether anybody >>> has a clear preference, and why. >>> >> >> My vote is for a type alias. Using a named type doesn't make any >> difference for type parameter constraints, and I'd prefer it if >> "[]interface{}" and "[]any" (or other types involving interface{}) weren't >> incompatible types. "interface{}" is currently a nice universally >> understood type - I don't think it's worth splitting it into two distinct >> types. >> >> cheers, >> rog. >> >> >> >> >>> 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/CAOyqgcUFU_Lz0c%3D-6V6N9X2Ku2Hx-9%2BDeHequ0oLX9Soyo_3GQ%40mail.gmail.com >>> <https://groups.google.com/d/msgid/golang-nuts/CAOyqgcUFU_Lz0c%3D-6V6N9X2Ku2Hx-9%2BDeHequ0oLX9Soyo_3GQ%40mail.gmail.com?utm_medium=email&utm_source=footer> >>> . >>> >> -- 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/CAJhgacgo9Ww3dMkpLxw-raAq97mMD4t6ZWsW0yX%3DFqDV%3DEBRHA%40mail.gmail.com.