On Fri, Jul 3, 2020 at 9:46 AM Davor Kapša <davor.ka...@gmail.com> wrote: > > Is it planned to combine type list with embed interfaces, > or it is too confusing ? > > type numeric interface { > type integers, floats > } > > type integers interface { > type int, int8, int16, int32, int64, unsigneds > } > > type unsigneds interface { > type uint, uint8, uint16, uint32, uint64 > } > > type floats interface { > type float32, float64 > } > > https://go2goplay.golang.org/p/6X5WZxWIcHE > > Thanks for current draft, it feels very idiomatic to me.
Using an interface type in a type list has a defined meaning: the type argument must have as its underlying type that interface type. It doesn't mean what I think you want it to mean, which is to serve as a union of the type lists of the interface types. What you suggest would not be impossible, but it would mean making an exception to the rules for type lists. 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/CAOyqgcWu6GBjKWLz9PA5di5L1mC4p8tQuSfXJB_ME%2B0kcH1ykg%40mail.gmail.com.