...

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

Documentation: internal/types/testdata/fixedbugs

     1  // Copyright 2020 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 (
     8          A1[P any] [10]A1 /* ERROR "invalid recursive type" */ [P]
     9          A2[P any] [10]A2 /* ERROR "invalid recursive type" */ [*P]
    10          A3[P any] [10]*A3[P]
    11  
    12          L1[P any] []L1[P]
    13  
    14          S1[P any] struct{ f S1 /* ERROR "invalid recursive type" */ [P] }
    15          S2[P any] struct{ f S2 /* ERROR "invalid recursive type" */ [*P] } // like example in issue
    16          S3[P any] struct{ f *S3[P] }
    17  
    18          I1[P any] interface{ I1 /* ERROR "invalid recursive type" */ [P] }
    19          I2[P any] interface{ I2 /* ERROR "invalid recursive type" */ [*P] }
    20          I3[P any] interface{ *I3 /* ERROR "interface contains type constraints" */ [P] }
    21  )
    22  

View as plain text