aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRobert Griesemer <gri@golang.org>2022-01-27 21:26:27 -0800
committerRobert Griesemer <gri@golang.org>2022-01-28 22:21:55 +0000
commitb37c6e15477a934f894488751bed8abcf16b4f5c (patch)
tree8dfecff6b6a97f3395df66ac47f8fc901a9296d2
parent8f7d96f5bcb927a576a43b890f2643e521107665 (diff)
downloadgo-b37c6e15477a934f894488751bed8abcf16b4f5c.tar.gz
go-b37c6e15477a934f894488751bed8abcf16b4f5c.zip
go/types, types2: delete TypeList.String
This method is unused and was not discussed in the API proposals. Note that all error output goes through the local sprintf which handles arguments specially. Fixes #50760. Change-Id: Iae66b0253cc0ece037d3d280951dc2d223c119fb Reviewed-on: https://go-review.googlesource.com/c/go/+/381634 Trust: Robert Griesemer <gri@golang.org> Reviewed-by: Robert Findley <rfindley@google.com>
-rw-r--r--api/go1.18.txt1
-rw-r--r--src/cmd/compile/internal/types2/typelists.go11
-rw-r--r--src/go/types/typelists.go11
3 files changed, 0 insertions, 23 deletions
diff --git a/api/go1.18.txt b/api/go1.18.txt
index 7805d29eb7..2d05c3f41c 100644
--- a/api/go1.18.txt
+++ b/api/go1.18.txt
@@ -51,7 +51,6 @@ pkg go/types, method (*Term) Tilde() bool
pkg go/types, method (*Term) Type() Type
pkg go/types, method (*TypeList) At(int) Type
pkg go/types, method (*TypeList) Len() int
-pkg go/types, method (*TypeList) String() string
pkg go/types, method (*TypeParam) Constraint() Type
pkg go/types, method (*TypeParam) Index() int
pkg go/types, method (*TypeParam) Obj() *TypeName
diff --git a/src/cmd/compile/internal/types2/typelists.go b/src/cmd/compile/internal/types2/typelists.go
index 0b77edbde2..a2aba4a9a5 100644
--- a/src/cmd/compile/internal/types2/typelists.go
+++ b/src/cmd/compile/internal/types2/typelists.go
@@ -4,8 +4,6 @@
package types2
-import "bytes"
-
// TypeParamList holds a list of type parameters.
type TypeParamList struct{ tparams []*TypeParam }
@@ -54,15 +52,6 @@ func (l *TypeList) list() []Type {
return l.types
}
-func (l *TypeList) String() string {
- if l == nil || len(l.types) == 0 {
- return "[]"
- }
- var buf bytes.Buffer
- newTypeWriter(&buf, nil).typeList(l.types)
- return buf.String()
-}
-
// ----------------------------------------------------------------------------
// Implementation
diff --git a/src/go/types/typelists.go b/src/go/types/typelists.go
index aea19e946d..0f241356c3 100644
--- a/src/go/types/typelists.go
+++ b/src/go/types/typelists.go
@@ -4,8 +4,6 @@
package types
-import "bytes"
-
// TypeParamList holds a list of type parameters.
type TypeParamList struct{ tparams []*TypeParam }
@@ -54,15 +52,6 @@ func (l *TypeList) list() []Type {
return l.types
}
-func (l *TypeList) String() string {
- if l == nil || len(l.types) == 0 {
- return "[]"
- }
- var buf bytes.Buffer
- newTypeWriter(&buf, nil).typeList(l.types)
- return buf.String()
-}
-
// ----------------------------------------------------------------------------
// Implementation