| // Copyright 2010 The Go Authors. All rights reserved. |
| // Use of this source code is governed by a BSD-style |
| // license that can be found in the LICENSE file. |
| // Arguments to comparison must be |
| // assignable one to the other (or vice versa) |
| // so chan int can be compared against |
| // directional channels but channel of different |
| // direction cannot be compared against each other. |
| use(c1 == c2) // ERROR "invalid operation" |
| use(c2 == c1) // ERROR "invalid operation" |
| // Same applies to named types. |
| use(p1 == p2) // ERROR "invalid operation" |
| use(p2 == p1) // ERROR "invalid operation" |
| // Comparison of structs should have a good message |
| use(t3 == t3) // ERROR "struct" |