src/internal/types/testdata/fixedbugs/issue50918.go
raw| 1 | // Copyright 2022 The Go Authors. All rights reserved. |
| 2 | // Use of this source code is governed by a BSD-style |
| 3 | // license that can be found in the LICENSE file. |
| 4 | |
| 5 | package p |
| 6 | |
| 7 | type thing1 struct { |
| 8 | things []string |
| 9 | } |
| 10 | |
| 11 | type thing2 struct { |
| 12 | things []thing1 |
| 13 | } |
| 14 | |
| 15 | func _() { |
| 16 | var a1, b1 thing1 |
| 17 | _ = a1 /* ERROR "struct containing []string cannot be compared" */ == b1 |
| 18 | |
| 19 | var a2, b2 thing2 |
| 20 | _ = a2 /* ERROR "struct containing []thing1 cannot be compared" */ == b2 |
| 21 | } |