Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.Sign up
GitHub is where the world builds software
Millions of developers and companies build, ship, and maintain their software on GitHub — the largest and most advanced development platform in the world.
cmd/go2go: usage of interface with type list not as type constraint shouldn't be allowed #41124
What version of Go are you using (
This shouldn't pass the type checker. You aren't allowed to embed an interface with a type list into a struct. An interface with a type list can only be used as a type constraint, not as a general type.
So, yes, the translation tool mishandles it, but this code shouldn't get to the translation tool at all.
…constraints Check that such constraint interfaces don't appear in: - composite types - type and function instantiations - assertions - type switches Streamlined respective error messages. Added lots of tests. Fixes #41124. Change-Id: Ie04a95ab056b40561484f04ed6e843ca371e1d41 Reviewed-on: https://go-review.googlesource.com/c/go/+/251718 Run-TryBot: Robert Griesemer <firstname.lastname@example.org> TryBot-Result: Gobot Gobot <email@example.com> Reviewed-by: Robert Griesemer <firstname.lastname@example.org>