Skip to content

Commit 76dd01f

Browse files
committed
cmd/compile/internal/types2: reduce output when describing type parameters
There's no need to say "type parameter" for a type parameter. The name is sufficient (they are always named), and the prose is followed by "constrained by". Change-Id: I98df8caa1432b8b7a874e58da6e3ed6be102b4a0 Reviewed-on: https://go-review.googlesource.com/c/go/+/357410 Trust: Robert Griesemer <[email protected]> Run-TryBot: Robert Griesemer <[email protected]> TryBot-Result: Go Bot <[email protected]> Reviewed-by: Robert Findley <[email protected]>
1 parent ff8115d commit 76dd01f

File tree

1 file changed

+1
-4
lines changed

1 file changed

+1
-4
lines changed

src/cmd/compile/internal/types2/operand.go

+1-4
Original file line numberDiff line numberDiff line change
@@ -176,17 +176,14 @@ func operandString(x *operand, qf Qualifier) string {
176176
if hasType {
177177
if x.typ != Typ[Invalid] {
178178
var intro string
179-
var tpar *TypeParam
180179
if isGeneric(x.typ) {
181180
intro = " of parameterized type "
182-
} else if tpar = asTypeParam(x.typ); tpar != nil {
183-
intro = " of type parameter "
184181
} else {
185182
intro = " of type "
186183
}
187184
buf.WriteString(intro)
188185
WriteType(&buf, x.typ, qf)
189-
if tpar != nil {
186+
if tpar := asTypeParam(x.typ); tpar != nil {
190187
buf.WriteString(" constrained by ")
191188
WriteType(&buf, tpar.bound, qf) // do not compute interface type sets here
192189
}

0 commit comments

Comments
 (0)