Source file
test/typeparam/issue51232.go
1
2
3
4
5
6
7 package p
8
9 type RC[RG any] interface {
10 ~[]RG
11 }
12
13 type Fn[RCT RC[RG], RG any] func(RCT)
14
15 type F[RCT RC[RG], RG any] interface {
16 Fn() Fn[RCT]
17 }
18
19 type concreteF[RCT RC[RG], RG any] struct {
20 makeFn func() Fn[RCT]
21 }
22
23 func (c *concreteF[RCT, RG]) Fn() Fn[RCT] {
24 return c.makeFn()
25 }
26
27 func NewConcrete[RCT RC[RG], RG any](Rc RCT) F[RCT] {
28 return &concreteF[RCT]{
29 makeFn: nil,
30 }
31 }
32
View as plain text