From: Robert Findley Date: Wed, 18 Aug 2021 17:22:58 +0000 (-0400) Subject: go/types: add the TypeParam.Obj method X-Git-Tag: go1.18beta1~1669 X-Git-Url: http://www.git.cypherpunks.su/?a=commitdiff_plain;h=9fe5c7f122;p=gostls13.git 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 Run-TryBot: Robert Findley Reviewed-by: Robert Griesemer --- 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)