aboutsummaryrefslogtreecommitdiff
path: root/test/fixedbugs
diff options
context:
space:
mode:
authorRobert Griesemer <gri@golang.org>2022-08-25 16:41:35 -0700
committerGopher Robot <gobot@golang.org>2022-09-01 22:37:04 +0000
commitaa5ff29dabbfdda036b8a1f5c5a80f239b876abc (patch)
tree80ae617f31caf18eff3cd21443487ef73c68cc8f /test/fixedbugs
parentc801e4b10f708c180a3708bcf39881338691287c (diff)
downloadgo-aa5ff29dabbfdda036b8a1f5c5a80f239b876abc.tar.xz
go/parser: adjustments to error messages
- Use "expected X" rather then "expecting X". - Report a better error when a type argument list is expected. - Adjust various tests. For #54511. Change-Id: I0c5ca66ecbbdcae1a8f67377682aae6b0b6ab89a Reviewed-on: https://go-review.googlesource.com/c/go/+/425734 TryBot-Result: Gopher Robot <gobot@golang.org> Reviewed-by: Alan Donovan <adonovan@google.com> Run-TryBot: Robert Griesemer <gri@google.com> Reviewed-by: Robert Griesemer <gri@google.com> Auto-Submit: Robert Griesemer <gri@google.com>
Diffstat (limited to 'test/fixedbugs')
-rw-r--r--test/fixedbugs/issue13273.go8
-rw-r--r--test/fixedbugs/issue18092.go2
-rw-r--r--test/fixedbugs/issue18747.go2
-rw-r--r--test/fixedbugs/issue19667.go2
-rw-r--r--test/fixedbugs/issue23664.go4
-rw-r--r--test/fixedbugs/issue33386.go10
6 files changed, 14 insertions, 14 deletions
diff --git a/test/fixedbugs/issue13273.go b/test/fixedbugs/issue13273.go
index 2498da4d47..ea729d6080 100644
--- a/test/fixedbugs/issue13273.go
+++ b/test/fixedbugs/issue13273.go
@@ -47,9 +47,9 @@ func f() {
<-(<-chan (<-chan (<-chan (<-chan int))))(nil)
<-(<-chan (<-chan (<-chan (<-chan (<-chan int)))))(nil)
- type _ <-<-chan int // ERROR "unexpected <-, expecting chan|expected .*chan.*"
- <-<-chan int // ERROR "unexpected <-, expecting chan|expecting {" (new parser: same error as for type decl)
+ type _ <-<-chan int // ERROR "unexpected <-, expected chan|expected .*chan.*"
+ <-<-chan int // ERROR "unexpected <-, expected chan|expecting {" (new parser: same error as for type decl)
- type _ <-chan<-int // ERROR "unexpected int, expecting chan|expected .*chan.*|expecting chan|expected .*;.* or .*}.* or newline"
- <-chan<-int // ERROR "unexpected int, expecting chan|expecting {" (new parser: same error as for type decl)
+ type _ <-chan<-int // ERROR "unexpected int, expected chan|expected .*chan.*|expected chan|expected .*;.* or .*}.* or newline"
+ <-chan<-int // ERROR "unexpected int, expected chan|expecting {" (new parser: same error as for type decl)
}
diff --git a/test/fixedbugs/issue18092.go b/test/fixedbugs/issue18092.go
index a0f7eddda5..c8e60f31c5 100644
--- a/test/fixedbugs/issue18092.go
+++ b/test/fixedbugs/issue18092.go
@@ -11,5 +11,5 @@ func _() {
select {
default:
case <-ch { // GCCGO_ERROR "expected colon"
- } // GC_ERROR "expecting :"
+ } // GC_ERROR "expected :"
}
diff --git a/test/fixedbugs/issue18747.go b/test/fixedbugs/issue18747.go
index fb8331fcc9..4eabe0e61d 100644
--- a/test/fixedbugs/issue18747.go
+++ b/test/fixedbugs/issue18747.go
@@ -23,6 +23,6 @@ func _ () {
if ; foo {}
- if foo // ERROR "unexpected newline, expecting { after if clause"
+ if foo // ERROR "unexpected newline, expected { after if clause"
{}
}
diff --git a/test/fixedbugs/issue19667.go b/test/fixedbugs/issue19667.go
index e33e350487..4b0925add2 100644
--- a/test/fixedbugs/issue19667.go
+++ b/test/fixedbugs/issue19667.go
@@ -10,4 +10,4 @@ package p
func f() {
if err := http.ListenAndServe( // GCCGO_ERROR "undefined name"
-} // ERROR "unexpected }, expecting expression|expected operand|missing .*\)|expected .*;|expected .*{"
+} // ERROR "unexpected }, expected expression|expected operand|missing .*\)|expected .*;|expected .*{"
diff --git a/test/fixedbugs/issue23664.go b/test/fixedbugs/issue23664.go
index 1925ebffe7..715654be70 100644
--- a/test/fixedbugs/issue23664.go
+++ b/test/fixedbugs/issue23664.go
@@ -9,9 +9,9 @@
package p
func f() {
- if f() true { // ERROR "unexpected true, expecting {"
+ if f() true { // ERROR "unexpected true, expected {"
}
- switch f() true { // ERROR "unexpected true, expecting {"
+ switch f() true { // ERROR "unexpected true, expected {"
}
}
diff --git a/test/fixedbugs/issue33386.go b/test/fixedbugs/issue33386.go
index 7b2f565285..a7074069fe 100644
--- a/test/fixedbugs/issue33386.go
+++ b/test/fixedbugs/issue33386.go
@@ -13,17 +13,17 @@ package p
func _() {
go func() { // no error here about goroutine
send <- // GCCGO_ERROR "undefined name"
- }() // ERROR "expecting expression|expected operand"
+ }() // ERROR "expected expression|expected operand"
}
func _() {
defer func() { // no error here about deferred function
1 + // GCCGO_ERROR "value computed is not used"
- }() // ERROR "expecting expression|expected operand"
+ }() // ERROR "expected expression|expected operand"
}
func _() {
- _ = (1 +) // ERROR "expecting expression|expected operand"
- _ = a[2 +] // ERROR "expecting expression|expected operand|undefined name"
- _ = []int{1, 2, 3 + } // ERROR "expecting expression|expected operand"
+ _ = (1 +) // ERROR "expected expression|expected operand"
+ _ = a[2 +] // ERROR "expected expression|expected operand|undefined name"
+ _ = []int{1, 2, 3 + } // ERROR "expected expression|expected operand"
}