| 1 |
// errorcheck |
| 2 |
|
| 3 |
// Copyright 2020 The Go Authors. All rights reserved. Use of this |
| 4 |
// source code is governed by a BSD-style license that can be found in |
| 5 |
// the LICENSE file. |
| 6 |
|
| 7 |
package p |
| 8 |
|
| 9 |
type T1 struct { // ERROR "invalid recursive type T1\n.*T1 refers to T2\n.*T2 refers to T1|invalid recursive type" |
| 10 |
f2 T2 |
| 11 |
} |
| 12 |
|
| 13 |
type T2 struct { // GCCGO_ERROR "invalid recursive type" |
| 14 |
f1 T1 |
| 15 |
} |
| 16 |
|
| 17 |
type a b // GCCGO_ERROR "invalid recursive type" |
| 18 |
type b c // ERROR "invalid recursive type b\n.*b refers to c\n.*c refers to b|invalid recursive type|invalid recursive type" |
| 19 |
type c b // GCCGO_ERROR "invalid recursive type" |
| 20 |
|
| 21 |
type d e |
| 22 |
type e f |
| 23 |
type f f // ERROR "invalid recursive type: f refers to itself|invalid recursive type|invalid recursive type" |
| 24 |
|
| 25 |
type g struct { // ERROR "invalid recursive type: g refers to itself|invalid recursive type" |
| 26 |
h struct { |
| 27 |
g |
| 28 |
} |
| 29 |
} |
| 30 |
|
| 31 |
type w x |
| 32 |
type x y // ERROR "invalid recursive type x\n.*x refers to y\n.*y refers to z\n.*z refers to x|invalid recursive type" |
| 33 |
type y struct{ z } // GCCGO_ERROR "invalid recursive type" |
| 34 |
type z [10]x |
| 35 |
|
| 36 |
type w2 w // refer to the type loop again |