[dev.typeparams] go/types: eliminate need for unpack and asUnion functions
This is a straightforward port of CL 323355 to go/types, adjusted for
the different error reporting API in go/types.
Change-Id: I0f9d7ca0e0959e1e214ecd61eb85cc311e6409a2
Reviewed-on: https://go-review.googlesource.com/c/go/+/326679
Trust: Robert Findley <rfindley@google.com>
Run-TryBot: Robert Findley <rfindley@google.com>
TryBot-Result: Go Bot <gobot@golang.org> Reviewed-by: Robert Griesemer <gri@golang.org>