...

Source file src/cmd/compile/internal/syntax/testdata/interface.go

Documentation: cmd/compile/internal/syntax/testdata

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

View as plain text