...

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

Documentation: internal/types/testdata/fixedbugs

     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  import "unsafe"
     8  
     9  type T0 /* ERROR "invalid recursive type" */ [P T0[P]] struct{}
    10  
    11  type T1 /* ERROR "invalid recursive type" */ [P T2[P]] struct{}
    12  type T2[P T1[P]] struct{}
    13  
    14  type T3 /* ERROR "invalid recursive type" */ [P interface{ ~struct{ f T3[int] } }] struct{}
    15  
    16  // valid cycle in M
    17  type N[P M[P]] struct{}
    18  type M[Q any] struct { F *M[Q] }
    19  
    20  // "crazy" case
    21  type TC[P [unsafe.Sizeof(func() {
    22          type T [P [unsafe.Sizeof(func(){})]byte] struct{}
    23  })]byte] struct{}
    24  
    25  // test case from issue
    26  type X /* ERROR "invalid recursive type" */ [T any, PT X[T]] interface{}
    27  

View as plain text