Source file test/fixedbugs/issue41575.go

     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\tLINE: T1 refers to\n\tLINE+4: T2 refers to\n\tLINE: 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\tLINE: b refers to\n\tLINE+1: c refers to\n\tLINE: b$|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\n\tLINE: f refers to\n\tLINE: f$|invalid recursive type"
    24  
    25  type 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  
    31  type w x
    32  type 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"
    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
    37  

View as plain text