From 02e5913406b2ac354695471690b79d8d4242ad8d Mon Sep 17 00:00:00 2001 From: Robert Griesemer Date: Mon, 1 Nov 2021 15:00:16 -0700 Subject: [PATCH] go/types, types2: remove confusing debugging output in inference error message When type inference cannot infer type arguments it prints the list of inferred type arguments (often empty) at the end of the error message. This was meant as debugging support only. Removed for now. Eventually we should provide a better error message. Fixes #49272. Change-Id: I68d43a6ace91081009cab0f2fbad7bfbddf5e76b Reviewed-on: https://go-review.googlesource.com/c/go/+/360554 Trust: Robert Griesemer Trust: Dan Scales Run-TryBot: Robert Griesemer TryBot-Result: Go Bot Reviewed-by: Dan Scales --- src/cmd/compile/internal/types2/infer.go | 2 +- src/go/types/infer.go | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/cmd/compile/internal/types2/infer.go b/src/cmd/compile/internal/types2/infer.go index 156c2290f7..494e896ee9 100644 --- a/src/cmd/compile/internal/types2/infer.go +++ b/src/cmd/compile/internal/types2/infer.go @@ -218,7 +218,7 @@ func (check *Checker) infer(pos syntax.Pos, tparams []*TypeParam, targs []Type, // At least one type argument couldn't be inferred. assert(targs != nil && index >= 0 && targs[index] == nil) tpar := tparams[index] - check.errorf(pos, "cannot infer %s (%s) (%s)", tpar.obj.name, tpar.obj.pos, targs) + check.errorf(pos, "cannot infer %s (%s)", tpar.obj.name, tpar.obj.pos) return nil } diff --git a/src/go/types/infer.go b/src/go/types/infer.go index 3348c29476..43b9af348e 100644 --- a/src/go/types/infer.go +++ b/src/go/types/infer.go @@ -214,7 +214,7 @@ func (check *Checker) infer(posn positioner, tparams []*TypeParam, targs []Type, // At least one type argument couldn't be inferred. assert(index >= 0 && targs[index] == nil) tpar := tparams[index] - check.errorf(posn, _Todo, "cannot infer %s (%v) (%v)", tpar.obj.name, tpar.obj.pos, targs) + check.errorf(posn, _Todo, "cannot infer %s (%v)", tpar.obj.name, tpar.obj.pos) return nil } -- 2.50.0