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
|
|
|
|
|
|
|
type FFn[RCT RC[RG], RG any] func() Fn[RCT] // ERROR "got 1 arguments"
|
|
|
|
|
2022-02-24 14:35:16 -07:00
|
|
|
type F[RCT RC[RG], RG any] interface {
|
2022-02-24 12:18:24 -07:00
|
|
|
Fn() Fn[RCT] // ERROR "got 1 arguments"
|
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 {
|
2022-02-24 12:18:24 -07:00
|
|
|
makeFn FFn[RCT] // ERROR "got 1 arguments"
|
2022-02-24 14:35:16 -07:00
|
|
|
}
|
|
|
|
|
2022-02-24 12:18:24 -07:00
|
|
|
func (c *concreteF[RCT, RG]) Fn() Fn[RCT] { // ERROR "got 1 arguments"
|
2022-02-24 14:35:16 -07:00
|
|
|
return c.makeFn()
|
|
|
|
}
|