2022-02-24 12:18:24 -07:00
|
|
|
// errorcheck
|
2022-02-24 14:35:16 -07:00
|
|
|
|
|
|
|
// Copyright 2022 The Go Authors. All rights reserved.
|
|
|
|
// Use of this source code is governed by a BSD-style
|
|
|
|
// license that can be found in the LICENSE file.
|
|
|
|
package p
|
|
|
|
|
2022-02-24 12:18:24 -07:00
|
|
|
// As of issue #51527, type-type inference has been disabled.
|
|
|
|
|
2022-02-24 14:35:16 -07:00
|
|
|
type RC[RG any] interface {
|
|
|
|
~[]RG
|
|
|
|
}
|
2022-02-24 12:18:24 -07:00
|
|
|
|
2022-02-24 14:35:16 -07:00
|
|
|
type Fn[RCT RC[RG], RG any] func(RCT)
|
2022-02-24 12:18:24 -07:00
|
|
|
|
2023-11-20 18:43:13 -07:00
|
|
|
type FFn[RCT RC[RG], RG any] func() Fn[RCT] // ERROR "not enough type arguments for type Fn: have 1, want 2"
|
2022-02-24 12:18:24 -07:00
|
|
|
|
2022-02-24 14:35:16 -07:00
|
|
|
type F[RCT RC[RG], RG any] interface {
|
2023-11-20 18:43:13 -07:00
|
|
|
Fn() Fn[RCT] // ERROR "not enough type arguments for type Fn: have 1, want 2"
|
2022-02-24 14:35:16 -07:00
|
|
|
}
|
2022-02-24 12:18:24 -07:00
|
|
|
|
2022-02-24 14:35:16 -07:00
|
|
|
type concreteF[RCT RC[RG], RG any] struct {
|
2023-11-20 18:43:13 -07:00
|
|
|
makeFn FFn[RCT] // ERROR "not enough type arguments for type FFn: have 1, want 2"
|
2022-02-24 14:35:16 -07:00
|
|
|
}
|
|
|
|
|
2023-11-20 18:43:13 -07:00
|
|
|
func (c *concreteF[RCT, RG]) Fn() Fn[RCT] { // ERROR "not enough type arguments for type Fn: have 1, want 2"
|
2022-02-24 14:35:16 -07:00
|
|
|
return c.makeFn()
|
|
|
|
}
|