Source file src/internal/types/testdata/fixedbugs/issue51233.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 p
     6  
     7  // As of issue #51527, type-type inference has been disabled.
     8  
     9  type RC[RG any] interface {
    10  	~[]RG
    11  }
    12  
    13  type Fn[RCT RC[RG], RG any] func(RCT)
    14  
    15  type FFn[RCT RC[RG], RG any] func() Fn /* ERROR "not enough type arguments for type Fn: have 1, want 2" */ [RCT]
    16  
    17  type F[RCT RC[RG], RG any] interface {
    18  	Fn() Fn /* ERROR "not enough type arguments for type Fn: have 1, want 2" */ [RCT]
    19  }
    20  
    21  type concreteF[RCT RC[RG], RG any] struct {
    22  	makeFn FFn /* ERROR "not enough type arguments for type FFn: have 1, want 2" */ [RCT]
    23  }
    24  
    25  func (c *concreteF[RCT, RG]) Fn() Fn /* ERROR "not enough type arguments for type Fn: have 1, want 2" */ [RCT] {
    26  	return c.makeFn()
    27  }
    28  

View as plain text