]> Cypherpunks repositories - gostls13.git/commitdiff
[dev.typeparams] go/types,cmd/compile/internal/types2: fix TypeParams.At docs
authorMatthew Dempsky <mdempsky@google.com>
Thu, 29 Jul 2021 23:01:30 +0000 (16:01 -0700)
committerMatthew Dempsky <mdempsky@google.com>
Thu, 29 Jul 2021 23:14:24 +0000 (23:14 +0000)
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>
src/cmd/compile/internal/types2/typeparam.go
src/go/types/typeparam.go

index 9f8c921bf175a4fc8b0b0db9d1bd661db53ab665..2614f467b156303229a7ac3936a34300da2b13e0 100644 (file)
@@ -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]
 }
index 8c18b52a9a926781a3955b97c72120026607c19a..a3d60c16486e4d13734beae888517f9f789c9024 100644 (file)
@@ -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]
 }