]> Cypherpunks repositories - gostls13.git/commitdiff
go/types, types2: remove confusing debugging output in inference error message
authorRobert Griesemer <gri@golang.org>
Mon, 1 Nov 2021 22:00:16 +0000 (15:00 -0700)
committerRobert Griesemer <gri@golang.org>
Mon, 1 Nov 2021 22:55:50 +0000 (22:55 +0000)
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>
src/cmd/compile/internal/types2/infer.go
src/go/types/infer.go

index 156c2290f71f45e853a7b252cc096cc9f0602290..494e896ee972332b51530eeae9813a2678fa51da 100644 (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
 }
 
index 3348c294767e269a8a4088527a2d22aa68bc2e12..43b9af348e8496e3ea1a51b1b580c8fa45a0b2ac 100644 (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
 }