aboutsummaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorRobert Griesemer <gri@golang.org>2021-11-11 16:32:16 -0800
committerRobert Griesemer <gri@golang.org>2021-11-12 22:20:51 +0000
commitf9dcda3fd83e83fb29cc6b0f710faa49ba98a54b (patch)
treeaeb14e6545c8e2f6679d27bce85ab3d4912bb0ba /test
parent9150c16bced33ca591a55fe4fb64817dd659b285 (diff)
downloadgo-f9dcda3fd83e83fb29cc6b0f710faa49ba98a54b.tar.xz
cmd/compile/internal/types2: better error for type assertion/switch on type parameter value
Change-Id: I98751d0b2d8aefcf537b6d5200d0b52ffacf1105 Reviewed-on: https://go-review.googlesource.com/c/go/+/363439 Trust: Robert Griesemer <gri@golang.org> Run-TryBot: Robert Griesemer <gri@golang.org> Reviewed-by: Robert Findley <rfindley@google.com>
Diffstat (limited to 'test')
-rw-r--r--test/interface/explicit.go2
-rw-r--r--test/typeswitch3.go4
2 files changed, 3 insertions, 3 deletions
diff --git a/test/interface/explicit.go b/test/interface/explicit.go
index 1b7af6712b..f769f5878c 100644
--- a/test/interface/explicit.go
+++ b/test/interface/explicit.go
@@ -57,7 +57,7 @@ func main() {
// cannot type-assert non-interfaces
f := 2.0
- _ = f.(int) // ERROR "non-interface type|only valid for interface types|not an interface type"
+ _ = f.(int) // ERROR "non-interface type|only valid for interface types|not an interface"
}
diff --git a/test/typeswitch3.go b/test/typeswitch3.go
index a57889bc1d..2e144d81c0 100644
--- a/test/typeswitch3.go
+++ b/test/typeswitch3.go
@@ -42,7 +42,7 @@ func main() {
func noninterface() {
var i int
- switch i.(type) { // ERROR "cannot type switch on non-interface value|not an interface type"
+ switch i.(type) { // ERROR "cannot type switch on non-interface value|not an interface"
case string:
case int:
}
@@ -51,6 +51,6 @@ func noninterface() {
name string
}
var s S
- switch s.(type) { // ERROR "cannot type switch on non-interface value|not an interface type"
+ switch s.(type) { // ERROR "cannot type switch on non-interface value|not an interface"
}
}