Black Lives Matter. Support the Equal Justice Initiative.

Text file src/go/types/testdata/check/cycles3.src

Documentation: go/types/testdata/check

     1  // Copyright 2013 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  import "unsafe"
     8  
     9  var (
    10  	_ A = A(nil).a().b().c().d().e().f()
    11  	_ A = A(nil).b().c().d().e().f()
    12  	_ A = A(nil).c().d().e().f()
    13  	_ A = A(nil).d().e().f()
    14  	_ A = A(nil).e().f()
    15  	_ A = A(nil).f()
    16  	_ A = A(nil)
    17  )
    18  
    19  type (
    20  	A interface {
    21  		a() B
    22  		B
    23  	}
    24  
    25  	B interface {
    26  		b() C
    27  		C
    28  	}
    29  
    30  	C interface {
    31  		c() D
    32  		D
    33  	}
    34  
    35  	D interface {
    36  		d() E
    37  		E
    38  	}
    39  
    40  	E interface {
    41  		e() F
    42  		F
    43  	}
    44  
    45  	F interface {
    46  		f() A
    47  	}
    48  )
    49  
    50  type (
    51  	U /* ERROR cycle */ interface {
    52  		V
    53  	}
    54  
    55  	V interface {
    56  		v() [unsafe.Sizeof(u)]int
    57  	}
    58  )
    59  
    60  var u U
    61  

View as plain text