diff options
| author | Cuong Manh Le <cuong.manhle.vn@gmail.com> | 2024-06-20 22:58:24 +0700 |
|---|---|---|
| committer | Gopher Robot <gobot@golang.org> | 2024-06-20 16:46:54 +0000 |
| commit | 477ad7dd5151a2cb54fb68aa84ccbe9bb96ffbee (patch) | |
| tree | e5819ab28fb9b42024b15b0744085f176a9bbb03 /test | |
| parent | 4f77a83589baa5a3038cc6e35615084dc7e5f0c1 (diff) | |
| download | go-477ad7dd5151a2cb54fb68aa84ccbe9bb96ffbee.tar.xz | |
cmd/compile: support generic alias type
Type parameters on aliases are now allowed after #46477 accepted.
Updates #46477
Fixes #68054
Change-Id: Ic2e3b6f960a898163f47666e3a6bfe43b8cc22e2
Reviewed-on: https://go-review.googlesource.com/c/go/+/593715
Reviewed-by: Robert Griesemer <gri@google.com>
Reviewed-by: Matthew Dempsky <mdempsky@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Auto-Submit: Robert Griesemer <gri@google.com>
Diffstat (limited to 'test')
| -rw-r--r-- | test/fixedbugs/issue68054.go | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/test/fixedbugs/issue68054.go b/test/fixedbugs/issue68054.go new file mode 100644 index 0000000000..5409fc9081 --- /dev/null +++ b/test/fixedbugs/issue68054.go @@ -0,0 +1,23 @@ +// compile -goexperiment aliastypeparams + +// Copyright 2024 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 Seq[V any] = func(yield func(V) bool) + +func f[E any](seq Seq[E]) { + return +} + +func g() { + f(Seq[int](nil)) +} + +type T[P any] struct{} + +type A[P any] = T[P] + +var _ A[int] |
