Source file src/internal/types/testdata/fixedbugs/issue47887.go

     1  // Copyright 2021 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 Fooer[t any] interface {
     8  	foo(Barer[t])
     9  }
    10  type Barer[t any] interface {
    11  	bar(Bazer[t])
    12  }
    13  type Bazer[t any] interface {
    14  	Fooer[t]
    15  	baz(t)
    16  }
    17  
    18  type Int int
    19  
    20  func (n Int) baz(int) {}
    21  func (n Int) foo(b Barer[int]) { b.bar(n) }
    22  
    23  type F[t any] interface { f(G[t]) }
    24  type G[t any] interface { g(H[t]) }
    25  type H[t any] interface { F[t] }
    26  
    27  type T struct{}
    28  func (n T) f(b G[T]) { b.g(n) }
    29  

View as plain text