aboutsummaryrefslogtreecommitdiff
path: root/src/cmd/compile/internal/types2/typestring.go
diff options
context:
space:
mode:
authorRobert Griesemer <gri@golang.org>2021-05-14 10:05:16 -0700
committerRobert Griesemer <gri@golang.org>2021-05-14 22:42:22 +0000
commit0d1e293b2329a013f03ea3f742f1716098ee282c (patch)
tree85432a51484073d5995cec9c64c84abb15763375 /src/cmd/compile/internal/types2/typestring.go
parent03ed590e517980afc9c48816aced517fce2996ca (diff)
downloadgo-0d1e293b2329a013f03ea3f742f1716098ee282c.tar.gz
go-0d1e293b2329a013f03ea3f742f1716098ee282c.zip
[dev.typeparams] cmd/compile/internal/types2: print "incomplete" for interfaces in debug mode only
The /* incomplete */ comment printed for interfaces that have not been "completed" yet is not useful for end-users; it's here for type-checker debugging. Rather than trying to pass through a debug flag through all print routines (which may require new exported API), simply don't print the comment unless we have the debug flag set inside the type-checker. For #46167. Change-Id: Ibd22edfe63001dfd2b814eeb94c2d54d35afd88c Reviewed-on: https://go-review.googlesource.com/c/go/+/320150 Trust: Robert Griesemer <gri@golang.org> Run-TryBot: Robert Griesemer <gri@golang.org> TryBot-Result: Go Bot <gobot@golang.org> Reviewed-by: Robert Findley <rfindley@google.com>
Diffstat (limited to 'src/cmd/compile/internal/types2/typestring.go')
-rw-r--r--src/cmd/compile/internal/types2/typestring.go2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/cmd/compile/internal/types2/typestring.go b/src/cmd/compile/internal/types2/typestring.go
index 40016697b7..e85cc8ed35 100644
--- a/src/cmd/compile/internal/types2/typestring.go
+++ b/src/cmd/compile/internal/types2/typestring.go
@@ -226,7 +226,7 @@ func writeType(buf *bytes.Buffer, typ Type, qf Qualifier, visited []Type) {
empty = false
}
}
- if t.allMethods == nil || len(t.methods) > len(t.allMethods) {
+ if debug && (t.allMethods == nil || len(t.methods) > len(t.allMethods)) {
if !empty {
buf.WriteByte(' ')
}