]> Cypherpunks repositories - gostls13.git/commitdiff
go/types: add the TypeParam.Obj method
authorRobert Findley <rfindley@google.com>
Wed, 18 Aug 2021 17:22:58 +0000 (13:22 -0400)
committerRobert Findley <rfindley@google.com>
Mon, 23 Aug 2021 13:07:43 +0000 (13:07 +0000)
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>
src/go/types/typeparam.go

index 63925049472107cba52096609b77699b8c0c2c20..8d19d5db76841d7cf9430728e12f05bffb4497fd 100644 (file)
@@ -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)