aboutsummaryrefslogtreecommitdiff
path: root/src/cmd
diff options
context:
space:
mode:
authorRobert Griesemer <gri@golang.org>2023-01-18 13:34:48 -0800
committerGopher Robot <gobot@golang.org>2023-01-20 01:31:26 +0000
commitf52b8fa83f00b70215e9980b2d7fc0c52c873c3b (patch)
treed2c8c64a00c0c4605f6ad13b7645d3c0ef723c71 /src/cmd
parentcf9adf4a3e60f12c86b767a23f434cae1b771c27 (diff)
downloadgo-f52b8fa83f00b70215e9980b2d7fc0c52c873c3b.tar.xz
go/types: generate infer.go
Also, remove pos parameter from inferB (was unused). Change-Id: I050f64d9fe916628499a55ca46f15c1f58ed4d1d Reviewed-on: https://go-review.googlesource.com/c/go/+/461691 Auto-Submit: Robert Griesemer <gri@google.com> Reviewed-by: Robert Findley <rfindley@google.com> Run-TryBot: Robert Griesemer <gri@google.com> TryBot-Result: Gopher Robot <gobot@golang.org> Reviewed-by: Robert Griesemer <gri@google.com>
Diffstat (limited to 'src/cmd')
-rw-r--r--src/cmd/compile/internal/types2/infer.go6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/cmd/compile/internal/types2/infer.go b/src/cmd/compile/internal/types2/infer.go
index f8cd23f068..9f57476c57 100644
--- a/src/cmd/compile/internal/types2/infer.go
+++ b/src/cmd/compile/internal/types2/infer.go
@@ -222,7 +222,7 @@ func (check *Checker) infer(pos syntax.Pos, tparams []*TypeParam, targs []Type,
// See how far we get with constraint type inference.
// Note that even if we don't have any type arguments, constraint type inference
// may produce results for constraints that explicitly specify a type.
- targs, index = check.inferB(pos, tparams, targs)
+ targs, index = check.inferB(tparams, targs)
if targs == nil || index < 0 {
return targs
}
@@ -256,7 +256,7 @@ func (check *Checker) infer(pos syntax.Pos, tparams []*TypeParam, targs []Type,
// --- 4 ---
// Again, follow up with constraint type inference.
- targs, index = check.inferB(pos, tparams, targs)
+ targs, index = check.inferB(tparams, targs)
if targs == nil || index < 0 {
return targs
}
@@ -452,7 +452,7 @@ func (w *tpWalker) isParameterizedTypeList(list []Type) bool {
// first type argument in that list that couldn't be inferred (and thus is nil). If all
// type arguments were inferred successfully, index is < 0. The number of type arguments
// provided may be less than the number of type parameters, but there must be at least one.
-func (check *Checker) inferB(pos syntax.Pos, tparams []*TypeParam, targs []Type) (types []Type, index int) {
+func (check *Checker) inferB(tparams []*TypeParam, targs []Type) (types []Type, index int) {
assert(len(tparams) >= len(targs) && len(targs) > 0)
if traceInference {