diff options
| author | Youlin Feng <fengyoulin@live.com> | 2024-11-01 11:17:49 +0800 |
|---|---|---|
| committer | Gopher Robot <gobot@golang.org> | 2024-11-04 16:26:42 +0000 |
| commit | 76f3e0ac8d094b2bc5f8a3fb8a19d1d17a07fe2c (patch) | |
| tree | cc61cbae8a6534a32cfdb8238e27d4eb1f4ede4f /src/cmd/compile | |
| parent | 9c5f5bd6d31a8751b8281bb062dd86106fd3b722 (diff) | |
| download | go-76f3e0ac8d094b2bc5f8a3fb8a19d1d17a07fe2c.tar.xz | |
go/types, types2: print variadic argument in dotdotdot form in error message
If a variadic call to a variadic function has not enough/too many
arguments, then print the variadic argument in dotdotdot form
instead of as a slice type in the error message.
Fixes #70150
Change-Id: I81a802619b3b66195b303e2df2bafeb1433ad310
Reviewed-on: https://go-review.googlesource.com/c/go/+/624335
Reviewed-by: Robert Griesemer <gri@google.com>
Reviewed-by: Robert Findley <rfindley@google.com>
Auto-Submit: Robert Griesemer <gri@google.com>
Auto-Submit: Robert Findley <rfindley@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Diffstat (limited to 'src/cmd/compile')
| -rw-r--r-- | src/cmd/compile/internal/types2/call.go | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/cmd/compile/internal/types2/call.go b/src/cmd/compile/internal/types2/call.go index 4ff5fe49e7..9095349e1d 100644 --- a/src/cmd/compile/internal/types2/call.go +++ b/src/cmd/compile/internal/types2/call.go @@ -530,7 +530,7 @@ func (check *Checker) arguments(call *syntax.CallExpr, sig *Signature, targs []T } err := check.newError(WrongArgCount) err.addf(at, "%s arguments in call to %s", qualifier, call.Fun) - err.addf(nopos, "have %s", check.typesSummary(operandTypes(args), false)) + err.addf(nopos, "have %s", check.typesSummary(operandTypes(args), ddd)) err.addf(nopos, "want %s", check.typesSummary(varTypes(params), sig.variadic)) err.report() return |
