1
0
mirror of https://github.com/golang/go synced 2024-11-23 07:00:05 -07:00
go/test/typeparam/issue51233.go
Raghvender 4bf1ca4b0c cmd/compile: fix error message for mismatch between the number of type params and arguments
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>
2023-12-08 00:50:55 +00:00

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()
}