internal/typeparams: follow changes to Type in the go/ast and go/types
As discussed on both proposals to CL 348375 (#47781) and
CL 348376 (#47916), Go core changed the 'T' word to 'Type'.
Follows those changes as well.
Change-Id: I52c354cdc7494aaf3c63bfb136efa86159175314
Reviewed-on: https://go-review.googlesource.com/c/tools/+/348509
Reviewed-by: Robert Findley <rfindley@google.com>
Trust: Robert Findley <rfindley@google.com>
Trust: Rebecca Stambler <rstambler@golang.org>
Run-TryBot: Robert Findley <rfindley@google.com>
gopls-CI: kokoro <noreply+kokoro@google.com>
TryBot-Result: Go Bot <gobot@golang.org>
diff --git a/internal/typeparams/typeparams.go b/internal/typeparams/typeparams.go
index d459b32..e263537 100644
--- a/internal/typeparams/typeparams.go
+++ b/internal/typeparams/typeparams.go
@@ -44,13 +44,13 @@
// ForTypeDecl extracts the (possibly nil) type parameter node list from n.
func ForTypeDecl(n *ast.TypeSpec) *ast.FieldList {
- return n.TParams
+ return n.TypeParams
}
// ForFuncDecl extracts the (possibly nil) type parameter node list from n.
func ForFuncDecl(n *ast.FuncDecl) *ast.FieldList {
if n.Type != nil {
- return n.Type.TParams
+ return n.Type.TypeParams
}
return nil
}
@@ -58,7 +58,7 @@
// ForSignature extracts the (possibly empty) type parameter object list from
// sig.
func ForSignature(sig *types.Signature) []*types.TypeName {
- return tparamsSlice(sig.TParams())
+ return tparamsSlice(sig.TypeParams())
}
// IsComparable reports if iface is the comparable interface.
@@ -75,10 +75,10 @@
// ForNamed extracts the (possibly empty) type parameter object list from
// named.
func ForNamed(named *types.Named) []*types.TypeName {
- return tparamsSlice(named.TParams())
+ return tparamsSlice(named.TypeParams())
}
-func tparamsSlice(tparams *types.TParamList) []*types.TypeName {
+func tparamsSlice(tparams *types.TypeParamList) []*types.TypeName {
length := tparams.Len()
if length == 0 {
return nil
@@ -94,7 +94,7 @@
// NamedTArgs extracts the (possibly empty) type argument list from named.
func NamedTArgs(named *types.Named) []types.Type {
- targs := named.TArgs()
+ targs := named.TypeArgs()
numArgs := targs.Len()
typs := make([]types.Type, numArgs)