aboutsummaryrefslogtreecommitdiff
path: root/test/cmp6.go
diff options
context:
space:
mode:
authorRuss Cox <rsc@golang.org>2011-01-21 18:15:59 -0500
committerRuss Cox <rsc@golang.org>2011-01-21 18:15:59 -0500
commit7e84666df17574adb0287aa2ae29769c71cd013e (patch)
tree589fbe52894e4daae0d060e55b203ea5c4efc85d /test/cmp6.go
parent9e441e52156d3b5c795083544745c53124c6df4e (diff)
downloadgo-7e84666df17574adb0287aa2ae29769c71cd013e.tar.gz
go-7e84666df17574adb0287aa2ae29769c71cd013e.zip
gc: clearer error for struct == struct
cmp6.go:48: invalid operation: t3 == t3 (operator == not defined on struct) Fixes #1438. R=ken2 CC=golang-dev https://golang.org/cl/4003045
Diffstat (limited to 'test/cmp6.go')
-rw-r--r--test/cmp6.go7
1 files changed, 7 insertions, 0 deletions
diff --git a/test/cmp6.go b/test/cmp6.go
index 981a859531..4c06011873 100644
--- a/test/cmp6.go
+++ b/test/cmp6.go
@@ -11,6 +11,10 @@ func use(bool) {}
type T1 *int
type T2 *int
+type T3 struct {}
+
+var t3 T3
+
func main() {
// Arguments to comparison must be
// assignable one to the other (or vice versa)
@@ -39,4 +43,7 @@ func main() {
use(p2 == p2)
use(p3 == p1)
use(p3 == p2)
+
+ // Comparison of structs should have a good message
+ use(t3 == t3) // ERROR "struct"
}