aboutsummaryrefslogtreecommitdiff
path: root/src/go/types/assignments.go
diff options
context:
space:
mode:
authorChressie Himpel <chressie@google.com>2022-04-27 20:09:28 +0200
committerChressie Himpel <chressie@google.com>2022-04-27 20:09:28 +0200
commitec7f5165ddc680efbac18dc15b4905844d9e8db9 (patch)
treeeacc43345e3d6f0adfda16bfcf66e7e5096a85b9 /src/go/types/assignments.go
parentca6fd39cf6498d4507fc7cdaced55620c283a503 (diff)
parentf0ee7fda636408b4f04ca3f3b11788f662c90610 (diff)
downloadgo-ec7f5165ddc680efbac18dc15b4905844d9e8db9.tar.gz
go-ec7f5165ddc680efbac18dc15b4905844d9e8db9.zip
[dev.boringcrypto] all: merge master into dev.boringcrypto
Change-Id: Ic5f71c04f08c03319c043f35be501875adb0a3b0
Diffstat (limited to 'src/go/types/assignments.go')
-rw-r--r--src/go/types/assignments.go10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/go/types/assignments.go b/src/go/types/assignments.go
index 101e868d82f..98d75630efe 100644
--- a/src/go/types/assignments.go
+++ b/src/go/types/assignments.go
@@ -9,6 +9,7 @@ package types
import (
"fmt"
"go/ast"
+ "go/token"
"strings"
)
@@ -339,11 +340,10 @@ func (check *Checker) initVars(lhs []*Var, origRHS []ast.Expr, returnStmt ast.St
} else if len(rhs) > 0 {
at = rhs[len(rhs)-1].expr // report at last value
}
- check.errorf(at, _WrongResultCount, "%s return values\n\thave %s\n\twant %s",
- qualifier,
- check.typesSummary(operandTypes(rhs), false),
- check.typesSummary(varTypes(lhs), false),
- )
+ err := newErrorf(at, _WrongResultCount, "%s return values", qualifier)
+ err.errorf(token.NoPos, "have %s", check.typesSummary(operandTypes(rhs), false))
+ err.errorf(token.NoPos, "want %s", check.typesSummary(varTypes(lhs), false))
+ check.report(err)
return
}
if compilerErrorMessages {