aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatthew Dempsky <mdempsky@google.com>2021-07-29 16:01:30 -0700
committerMatthew Dempsky <mdempsky@google.com>2021-07-29 23:14:24 +0000
commit3e7571f6ffb65a7d45c8035f7f8d2409bfda3307 (patch)
tree62660494148f0d768e1ba97179fbf224b423303a
parent1d35d8ffa5561d1b69ede515c94c2785eaf29e1f (diff)
downloadgo-3e7571f6ffb65a7d45c8035f7f8d2409bfda3307.tar.gz
go-3e7571f6ffb65a7d45c8035f7f8d2409bfda3307.zip
[dev.typeparams] go/types,cmd/compile/internal/types2: fix TypeParams.At docs
Presumably the "It is safe to call on a nil receiver" comment was mistakenly copied from TypeParams.Len, which is actually safe to call on a nil receiver. Change-Id: Iec5ae32c98dc91ce84a6207b47f2b1e530bdbfe2 Reviewed-on: https://go-review.googlesource.com/c/go/+/338430 Trust: Matthew Dempsky <mdempsky@google.com> Run-TryBot: Matthew Dempsky <mdempsky@google.com> Reviewed-by: Robert Griesemer <gri@golang.org>
-rw-r--r--src/cmd/compile/internal/types2/typeparam.go1
-rw-r--r--src/go/types/typeparam.go1
2 files changed, 0 insertions, 2 deletions
diff --git a/src/cmd/compile/internal/types2/typeparam.go b/src/cmd/compile/internal/types2/typeparam.go
index 9f8c921bf1..2614f467b1 100644
--- a/src/cmd/compile/internal/types2/typeparam.go
+++ b/src/cmd/compile/internal/types2/typeparam.go
@@ -108,7 +108,6 @@ func (tps *TypeParams) Len() int {
}
// At returns the i'th type parameter in the list.
-// It is safe to call on a nil receiver.
func (tps *TypeParams) At(i int) *TypeName {
return tps.list()[i]
}
diff --git a/src/go/types/typeparam.go b/src/go/types/typeparam.go
index 8c18b52a9a..a3d60c1648 100644
--- a/src/go/types/typeparam.go
+++ b/src/go/types/typeparam.go
@@ -98,7 +98,6 @@ func (tps *TypeParams) Len() int {
}
// At returns the i'th type parameter in the list.
-// It is safe to call on a nil receiver.
func (tps *TypeParams) At(i int) *TypeName {
return tps.list()[i]
}