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
7package p
8
9type T1 struct { // ERROR "invalid recursive type T1\n\tLINE: T1 refers to\n\tLINE+4: T2 refers to\n\tLINE: T1$|invalid recursive type"
10	f2 T2
11}
12
13type T2 struct { // GCCGO_ERROR "invalid recursive type"
14	f1 T1
15}
16
17type a b // GCCGO_ERROR "invalid recursive type"
18type b c // ERROR "invalid recursive type b\n\tLINE: b refers to\n\tLINE+1: c refers to\n\tLINE: b$|invalid recursive type"
19type c b // GCCGO_ERROR "invalid recursive type"
20
21type d e
22type e f
23type f f // ERROR "invalid recursive type f\n\tLINE: f refers to\n\tLINE: f$|invalid recursive type"
24
25type g struct { // ERROR "invalid recursive type g\n\tLINE: g refers to\n\tLINE: g$|invalid recursive type"
26	h struct {
27		g
28	}
29}
30
31type w x
32type x y           // ERROR "invalid recursive type x\n\tLINE: x refers to\n\tLINE+1: y refers to\n\tLINE+2: z refers to\n\tLINE: x$|invalid recursive type"
33type y struct{ z } // GCCGO_ERROR "invalid recursive type"
34type z [10]x
35
36type w2 w // refer to the type loop again
37