Text file src/go/parser/testdata/interface.go2

     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  // This file contains test cases for interfaces containing
     6  // constraint elements.
     7  
     8  package p
     9  
    10  type _ interface {
    11  	m()
    12  	~int
    13  	~int|string
    14  	E
    15  }
    16  
    17  type _ interface {
    18  	m()
    19  	~int
    20  	int | string
    21  	int | ~string
    22  	~int | ~string
    23  }
    24  
    25  type _ interface {
    26  	m()
    27  	~int
    28  	T[int, string] | string
    29  	int | ~T[string, struct{}]
    30  	~int | ~string
    31  }
    32  
    33  type _ interface {
    34  	int
    35  	[]byte
    36  	[10]int
    37  	struct{}
    38  	*int
    39  	func()
    40  	interface{}
    41  	map[string]int
    42  	chan T
    43  	chan<- T
    44  	<-chan T
    45  	T[int]
    46  }
    47  
    48  type _ interface {
    49  	int | string
    50  	[]byte | string
    51  	[10]int | string
    52  	struct{} | string
    53  	*int | string
    54  	func() | string
    55  	interface{} | string
    56  	map[string]int | string
    57  	chan T | string
    58  	chan<- T | string
    59  	<-chan T | string
    60  	T[int] | string
    61  }
    62  
    63  type _ interface {
    64  	~int | string
    65  	~[]byte | string
    66  	~[10]int | string
    67  	~struct{} | string
    68  	~*int | string
    69  	~func() | string
    70  	~interface{} | string
    71  	~map[string]int | string
    72  	~chan T | string
    73  	~chan<- T | string
    74  	~<-chan T | string
    75  	~T[int] | string
    76  }
    77  

View as plain text