diff options
author | Russ Cox <rsc@golang.org> | 2011-01-21 18:15:59 -0500 |
---|---|---|
committer | Russ Cox <rsc@golang.org> | 2011-01-21 18:15:59 -0500 |
commit | 286c1efb2ae1ff4a2bc7e8da4bad19eb6677cb10 (patch) | |
tree | 1d3e97ae4223be2618149b8276b7a47af35ff9cf /test/cmp6.go | |
parent | c48a2f1ea13505dd080e8fd076204cc455e3214b (diff) | |
download | go-286c1efb2ae1ff4a2bc7e8da4bad19eb6677cb10.tar.gz |
gc: clearer error for struct == struct
cmp6.go:48: invalid operation: t3 == t3 (operator == not defined on struct)
Fixes issue 1438.
R=ken2
CC=golang-dev
http://codereview.appspot.com/4003045
Diffstat (limited to 'test/cmp6.go')
-rw-r--r-- | test/cmp6.go | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/test/cmp6.go b/test/cmp6.go index 981a85953..4c0601187 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" } |