github.com/go-asm/go@v1.21.1-0.20240213172139-40c5ead50c48/types/testdata/fixedbugs/issue48582.go (about)

     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 N /* ERROR "invalid recursive type" */ interface {
     8  	int | N
     9  }
    10  
    11  type A /* ERROR "invalid recursive type" */ interface {
    12  	int | B
    13  }
    14  
    15  type B interface {
    16  	int | A
    17  }
    18  
    19  type S /* ERROR "invalid recursive type" */ struct {
    20  	I // ERROR "interface contains type constraints"
    21  }
    22  
    23  type I interface {
    24  	int | S
    25  }
    26  
    27  type P interface {
    28  	*P // ERROR "interface contains type constraints"
    29  }