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 type RC[RG any] interface {
8 ~[]RG
9 }
10
11 type Fn[RCT RC[RG], RG any] func(RCT)
12
13 type F[RCT RC[RG], RG any] interface {
14 Fn() Fn /* ERROR got 1 arguments */ [RCT]
15 }
16
17 type concreteF[RCT RC[RG], RG any] struct {
18 makeFn func() Fn /* ERROR got 1 arguments */ [RCT]
19 }
20
21 func (c *concreteF[RCT, RG]) Fn() Fn /* ERROR got 1 arguments */ [RCT] {
22 return c.makeFn()
23 }
24
25 func NewConcrete[RCT RC[RG], RG any](Rc RCT) F /* ERROR got 1 arguments */ [RCT] {
26 // TODO(rfindley): eliminate the duplicate error below.
27 return & /* ERROR cannot use .* as F\[RCT\] */ concreteF /* ERROR got 1 arguments */ [RCT]{
28 makeFn: nil,
29 }
30 }
31
View as plain text