diff options
author | Robert Findley <rfindley@google.com> | 2021-08-18 13:22:58 -0400 |
---|---|---|
committer | Robert Findley <rfindley@google.com> | 2021-08-23 13:07:43 +0000 |
commit | 9fe5c7f12274fd4044457e863cbb8bc3ae751dcb (patch) | |
tree | 1eb8966ff349d80dbcdfcd620d25aa2a23286a68 /src | |
parent | baf2866956c2e03952383e19287a1e562cf09170 (diff) | |
download | go-9fe5c7f12274fd4044457e863cbb8bc3ae751dcb.tar.gz go-9fe5c7f12274fd4044457e863cbb8bc3ae751dcb.zip |
go/types: add the TypeParam.Obj method
Users should be able to access the type name associated with a type
parameter.
Change-Id: I495c3b4377f9d4807b1e78ad341e573d4d3c7bff
Reviewed-on: https://go-review.googlesource.com/c/go/+/343931
Trust: Robert Findley <rfindley@google.com>
Run-TryBot: Robert Findley <rfindley@google.com>
Reviewed-by: Robert Griesemer <gri@golang.org>
Diffstat (limited to 'src')
-rw-r--r-- | src/go/types/typeparam.go | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/src/go/types/typeparam.go b/src/go/types/typeparam.go index 6392504947..8d19d5db76 100644 --- a/src/go/types/typeparam.go +++ b/src/go/types/typeparam.go @@ -60,6 +60,9 @@ func (t *TypeParam) _SetId(id uint64) { t.id = id } +// Obj returns the type name for t. +func (t *TypeParam) Obj() *TypeName { return t.obj } + // Constraint returns the type constraint specified for t. func (t *TypeParam) Constraint() Type { // compute the type set if possible (we may not have an interface) |