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

     1  // Copyright 2024 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 A[P any] [1]P
     8  
     9  type B[P any] A[P]
    10  
    11  type C /* ERROR "invalid recursive type" */ B[C]
    12  
    13  // test case from issue
    14  
    15  type Foo[T any] struct {
    16  	baz T
    17  }
    18  
    19  type Bar[T any] struct {
    20  	foo Foo[T]
    21  }
    22  
    23  type Baz /* ERROR "invalid recursive type" */ struct {
    24  	bar Bar[Baz]
    25  }
    26  

View as plain text