Source file test/typeparam/issue50481c.dir/a.go

     1  // Copyright 2022 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 a
     6  
     7  type A interface {
     8  	int | int64
     9  }
    10  
    11  type B interface {
    12  	string
    13  }
    14  
    15  type C interface {
    16  	String() string
    17  }
    18  
    19  type Myint int
    20  
    21  func (i Myint) String() string {
    22  	return "aa"
    23  }
    24  
    25  type T[P A, _ C, _ B] int
    26  
    27  func (v T[P, Q, R]) test() {
    28  	var r Q
    29  	r.String()
    30  }
    31  

View as plain text