1
0
mirror of https://github.com/golang/go synced 2024-11-26 15:46:54 -07:00

cmd/compile/internal/types2: match go/types for "..." related error msg

For #54511.

Change-Id: I571680dfc25d7b7198e84e11bd311ab8b24d72d9
Reviewed-on: https://go-review.googlesource.com/c/go/+/424818
Reviewed-by: Robert Findley <rfindley@google.com>
Reviewed-by: Robert Griesemer <gri@google.com>
Run-TryBot: Robert Griesemer <gri@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
This commit is contained in:
Robert Griesemer 2022-08-18 10:40:31 -07:00
parent 8892a51745
commit 4a954fafa3
2 changed files with 3 additions and 3 deletions

View File

@ -137,7 +137,7 @@ func (check *Checker) callExpr(x *operand, call *syntax.CallExpr) exprKind {
} }
} }
if call.HasDots { if call.HasDots {
check.errorf(call.ArgList[0], "invalid use of ... in type conversion to %s", T) check.errorf(call.ArgList[0], "invalid use of ... in conversion to %s", T)
break break
} }
check.conversion(x, T) check.conversion(x, T)

View File

@ -4,7 +4,7 @@
package p package p
var _ = int(0 /* ERROR invalid use of \.\.\. in type conversion */ ...) var _ = int(0 /* ERROR invalid use of \.\.\. in conversion to int */ ...)
// test case from issue // test case from issue
@ -12,5 +12,5 @@ type M []string
var ( var (
x = []string{"a", "b"} x = []string{"a", "b"}
_ = M(x /* ERROR invalid use of \.\.\. in type conversion */ ...) _ = M(x /* ERROR invalid use of \.\.\. in conversion to M */ ...)
) )