]> Cypherpunks repositories - gostls13.git/commitdiff
cmd/compile/internal/types2: match go/types for "..." related error msg
authorRobert Griesemer <gri@golang.org>
Thu, 18 Aug 2022 17:40:31 +0000 (10:40 -0700)
committerRobert Griesemer <gri@golang.org>
Fri, 19 Aug 2022 17:46:05 +0000 (17:46 +0000)
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>

src/cmd/compile/internal/types2/call.go
src/cmd/compile/internal/types2/testdata/fixedbugs/issue43124.go

index b1ea6917fb1a21a235e8f0b48e707033653b2995..bb0f86b2d63afa7e8d6311c6e65616ae10586550 100644 (file)
@@ -137,7 +137,7 @@ func (check *Checker) callExpr(x *operand, call *syntax.CallExpr) exprKind {
                                        }
                                }
                                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
                                }
                                check.conversion(x, T)
index 7e48c2211b2c42bac91738c238530b251e29db8a..f429f74a74f95cbe58a5356625596143dc6d3167 100644 (file)
@@ -4,7 +4,7 @@
 
 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
 
@@ -12,5 +12,5 @@ type M []string
 
 var (
        x = []string{"a", "b"}
-       _ = M(x /* ERROR invalid use of \.\.\. in type conversion */ ...)
+       _ = M(x /* ERROR invalid use of \.\.\. in conversion to M */ ...)
 )