This is a port of CL 341856 to go/types. It is adjusted to use the
NumTArgs/TArg API of go/types, which has not yet been ported to types2.
Change-Id: I6faeec027f4ae08634267001f473263703e80c5b
Reviewed-on: https://go-review.googlesource.com/c/go/+/342478
Trust: Robert Findley <rfindley@google.com>
Run-TryBot: Robert Findley <rfindley@google.com> Reviewed-by: Robert Griesemer <gri@golang.org>
TryBot-Result: Go Bot <gobot@golang.org>