From f52b8fa83f00b70215e9980b2d7fc0c52c873c3b Mon Sep 17 00:00:00 2001 From: Robert Griesemer Date: Wed, 18 Jan 2023 13:34:48 -0800 Subject: 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 Reviewed-by: Robert Findley Run-TryBot: Robert Griesemer TryBot-Result: Gopher Robot Reviewed-by: Robert Griesemer --- src/cmd/compile/internal/types2/infer.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/cmd') 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 { -- cgit v1.3