`Union[T, error]` is defined as interface { type T, error }
An interface containing a type-list can only be used as a constraint. However, you are using it as a type in several places. On Sat, Dec 26, 2020 at 10:22 PM thwd <sedeveloper...@gmail.com> wrote: > My (short) code: > https://go2goplay.golang.org/p/J4Ovyt-4xXN > > The spec: > > https://go.googlesource.com/proposal/+/refs/heads/master/design/go2draft-type-parameters.md > > The errors: > prog.go2:7:30: interface contains type constraints (T, error) > prog.go2:19:32: interface contains type constraints (T, struct{}) > prog.go2:10:13: interface contains type constraints (T, error) > prog.go2:15:13: interface contains type constraints (T, error) > prog.go2:22:13: interface contains type constraints (T, struct{}) > > What am I doing wrong? > > -- > 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/6941a289-94b0-4bb1-99d2-c685652e46a8n%40googlegroups.com > <https://groups.google.com/d/msgid/golang-nuts/6941a289-94b0-4bb1-99d2-c685652e46a8n%40googlegroups.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/CAEkBMfHxsNtrZCqKZOLFKEdH7PC7oXy1%3D9H-ka-HA5qp7_up3w%40mail.gmail.com.