mirror of
https://github.com/golang/go
synced 2024-11-11 12:49:30 +00: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>
29 lines
816 B
Go
29 lines
816 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
|
|
|
|
// As of issue #51527, type-type inference has been disabled.
|
|
|
|
type RC[RG any] interface {
|
|
~[]RG
|
|
}
|
|
|
|
type Fn[RCT RC[RG], RG any] func(RCT)
|
|
|
|
type FFn[RCT RC[RG], RG any] func() Fn[RCT] // ERROR "not enough type arguments for type Fn: have 1, want 2"
|
|
|
|
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 FFn[RCT] // ERROR "not enough type arguments for type FFn: 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()
|
|
}
|