Source file test/fixedbugs/issue75022.go

     1  // errorcheck
     2  
     3  // Copyright 2026 The Go Authors. All rights reserved.
     4  // Use of this source code is governed by a BSD-style
     5  // license that can be found in the LICENSE file.
     6  
     7  package p
     8  
     9  type T[P any] struct {
    10  	_ P
    11  }
    12  
    13  type A T[A] // ERROR "invalid recursive type A\n.*A refers to T\[A\]\n.*T\[A\] refers to A"
    14  
    15  type B = C
    16  type C T[B] // ERROR "invalid recursive type C\n.*C refers to T\[B\]\n.*T\[B\] refers to C"
    17  
    18  type D = T[D] // ERROR "invalid recursive type: D refers to itself"
    19  
    20  type E T[T[E]] // ERROR "invalid recursive type E\n.*E refers to T\[T\[E\]\]\n.*T\[T\[E\]\] refers to T\[E\]\n.*T\[E\] refers to E"
    21  

View as plain text