mirror of
https://github.com/golang/go
synced 2024-11-22 18:34:51 -07:00
4bf1ca4b0c
Fixes #64276 Change-Id: Ib6651669904e6ea0daf275d85d8bd008b8b21cc6 Reviewed-on: https://go-review.googlesource.com/c/go/+/544018 Reviewed-by: raghvender sundarjee <raghvenders@gmail.com> Reviewed-by: Dmitri Shuralyov <dmitshur@google.com> Auto-Submit: Robert Griesemer <gri@google.com> Reviewed-by: Robert Griesemer <gri@google.com> Run-TryBot: Robert Griesemer <gri@google.com> TryBot-Result: Gopher Robot <gobot@golang.org>
32 lines
898 B
Go
32 lines
898 B
Go
// errorcheck
|
|
|
|
// 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
|
|
|
|
type RC[RG any] interface {
|
|
~[]RG
|
|
}
|
|
|
|
type Fn[RCT RC[RG], RG any] func(RCT)
|
|
|
|
type F[RCT RC[RG], RG any] interface {
|
|
Fn() Fn[RCT] // ERROR "not enough type arguments for type Fn: have 1, want 2"
|
|
}
|
|
|
|
type concreteF[RCT RC[RG], RG any] struct {
|
|
makeFn func() Fn[RCT] // ERROR "not enough type arguments for type Fn: have 1, want 2"
|
|
}
|
|
|
|
func (c *concreteF[RCT, RG]) Fn() Fn[RCT] { // ERROR "not enough type arguments for type Fn: have 1, want 2"
|
|
return c.makeFn()
|
|
}
|
|
|
|
func NewConcrete[RCT RC[RG], RG any](Rc RCT) F[RCT] { // ERROR "not enough type arguments for type F: have 1, want 2"
|
|
return &concreteF[RCT]{ // ERROR "cannot use" "not enough type arguments for type concreteF: have 1, want 2"
|
|
makeFn: nil,
|
|
}
|
|
}
|