aboutsummaryrefslogtreecommitdiff
path: root/test/append1.go
diff options
context:
space:
mode:
authorRobert Griesemer <gri@golang.org>2022-09-28 14:13:24 -0700
committerGopher Robot <gobot@golang.org>2022-09-28 22:28:39 +0000
commit7997e5f2540deb03a88a2f68f83bb5e5b7d6f77e (patch)
tree9751a58de41b9d7a292a40d9f3b31224d5f0d3b8 /test/append1.go
parent435652b468f0b71266f760490896ac3e9cf46eba (diff)
downloadgo-7997e5f2540deb03a88a2f68f83bb5e5b7d6f77e.tar.gz
go-7997e5f2540deb03a88a2f68f83bb5e5b7d6f77e.zip
cmd/compile: use "cannot use %s as %s value in %s: %s" error message
This is close to what the compiler used to say, except now we say "as T value" rather than "as type T" which is closer to the truth (we cannot use a value as a type, after all). Also, place the primary error and the explanation (cause) on a single line. Make respective (single line) adjustment to the matching "cannot convert" error. Adjust various tests. For #55326. Change-Id: Ib646cf906b11f4129b7ed0c38cf16471f9266b88 Reviewed-on: https://go-review.googlesource.com/c/go/+/436176 Reviewed-by: Robert Griesemer <gri@google.com> Run-TryBot: Robert Griesemer <gri@google.com> Auto-Submit: Robert Griesemer <gri@google.com> Reviewed-by: Robert Findley <rfindley@google.com> TryBot-Result: Gopher Robot <gobot@golang.org>
Diffstat (limited to 'test/append1.go')
-rw-r--r--test/append1.go2
1 files changed, 1 insertions, 1 deletions
diff --git a/test/append1.go b/test/append1.go
index 397be570d9..437e30ca23 100644
--- a/test/append1.go
+++ b/test/append1.go
@@ -17,6 +17,6 @@ func main() {
_ = append(s...) // ERROR "cannot use ... on first argument|not enough arguments in call to append"
_ = append(s, 2, s...) // ERROR "too many arguments to append|too many arguments in call to append"
- _ = append(s, make([]int, 0)) // ERROR "cannot use make.* as type int in append|cannot use make.* \(value of type \[\]int\) as type int in argument to append"
+ _ = append(s, make([]int, 0)) // ERROR "cannot use make\(\[\]int, 0\) \(value of type \[\]int\) as int value in argument to append"
_ = append(s, make([]int, -1)...) // ERROR "negative len argument in make|index -1.* must not be negative"
}