Source file test/fixedbugs/issue65362.go

     1  // compile
     2  
     3  // Copyright 2024 The Go Authors. All rights reserved.
     4  // Use of this source code is governed by a BSD-style
     5  // license that can be found in the LICENSE file.
     6  
     7  package main
     8  
     9  type Vector[V any] interface {
    10  	ReadVector[V]
    11  }
    12  
    13  type ReadVector[V any] interface {
    14  	Comparisons[ReadVector[V], Vector[V]]
    15  }
    16  
    17  type Comparisons[RV, V any] interface {
    18  	Diff(RV) V
    19  }
    20  
    21  type VectorImpl[V any] struct{}
    22  
    23  func (*VectorImpl[V]) Diff(ReadVector[V]) (_ Vector[V]) {
    24  	return
    25  }
    26  
    27  func main() {
    28  	var v1 VectorImpl[int]
    29  	var v2 Vector[int]
    30  	_ = v1.Diff(v2)
    31  }
    32  

View as plain text