aboutsummaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorRobert Griesemer <gri@golang.org>2024-09-30 14:10:40 -0700
committerRobert Griesemer <gri@google.com>2024-09-30 22:04:40 +0000
commitbae2e968e2daadd39c1bdb1221648361d7277ddc (patch)
treea64d9b090a2aa33fad9d008048c6ef7c5091b623 /test
parent0206eb9679dd3819c44912e6ebdba3b0fbf959a3 (diff)
downloadgo-bae2e968e2daadd39c1bdb1221648361d7277ddc.tar.xz
go/parser, syntax: better error message for parameter missing type
Fixes #69506. Change-Id: I18215e11f214b12d5f65be1d1740181e427f8817 Reviewed-on: https://go-review.googlesource.com/c/go/+/617015 Reviewed-by: Alan Donovan <adonovan@google.com> Reviewed-by: Robert Griesemer <gri@google.com> LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Diffstat (limited to 'test')
-rw-r--r--test/fixedbugs/bug388.go2
-rw-r--r--test/func3.go6
2 files changed, 4 insertions, 4 deletions
diff --git a/test/fixedbugs/bug388.go b/test/fixedbugs/bug388.go
index a060c9fd5a..0524534bb3 100644
--- a/test/fixedbugs/bug388.go
+++ b/test/fixedbugs/bug388.go
@@ -9,7 +9,7 @@
package main
import "runtime"
-func foo(runtime.UintType, i int) { // ERROR "cannot declare name runtime.UintType|mixed named and unnamed|undefined identifier"
+func foo(runtime.UintType, i int) { // ERROR "cannot declare name runtime.UintType|missing parameter name|undefined identifier"
println(i, runtime.UintType) // GCCGO_ERROR "undefined identifier"
}
diff --git a/test/func3.go b/test/func3.go
index 6be3bf0184..861ab2cba5 100644
--- a/test/func3.go
+++ b/test/func3.go
@@ -13,8 +13,8 @@ type t1 int
type t2 int
type t3 int
-func f1(*t2, x t3) // ERROR "named"
-func f2(t1, *t2, x t3) // ERROR "named"
-func f3() (x int, *string) // ERROR "named"
+func f1(*t2, x t3) // ERROR "missing parameter name"
+func f2(t1, *t2, x t3) // ERROR "missing parameter name"
+func f3() (x int, *string) // ERROR "missing parameter name"
func f4() (t1 t1) // legal - scope of parameter named t1 starts in body of f4.