1
0
mirror of https://github.com/golang/go synced 2024-11-17 22:34:47 -07:00

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 <gri@golang.org>
Trust: Dan Scales <danscales@google.com>
Run-TryBot: Robert Griesemer <gri@golang.org>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Dan Scales <danscales@google.com>
This commit is contained in:
Robert Griesemer 2021-11-01 15:00:16 -07:00
parent 5f1bcd1bc2
commit 02e5913406
2 changed files with 2 additions and 2 deletions

View File

@ -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
}

View File

@ -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
}