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>
func init() {
acceptMethodTypeParams = true
}
+
+// Debug is set if types2 is built with debug mode enabled.
+const Debug = debug
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(' ')
}
var nopos syntax.Pos
func TestIncompleteInterfaces(t *testing.T) {
+ if !Debug {
+ t.Skip("requires type checker to be compiled with debug = true")
+ }
+
sig := NewSignature(nil, nil, nil, false)
m := NewFunc(nopos, nil, "m", sig)
for _, test := range []struct {