]> Cypherpunks repositories - gostls13.git/commitdiff
go/types, types2: add testcase for alias issue
authorRobert Griesemer <gri@golang.org>
Thu, 30 Nov 2023 20:52:01 +0000 (12:52 -0800)
committerGopher Robot <gobot@golang.org>
Fri, 1 Dec 2023 20:43:52 +0000 (20:43 +0000)
Using the new type Alias node, this issue is now fixed.
Add a test case.

Fixes #50729.

Change-Id: I22a4cf31b83de497e052989ca2054227e65e9937
Reviewed-on: https://go-review.googlesource.com/c/go/+/546455
Run-TryBot: Robert Griesemer <gri@google.com>
Reviewed-by: Robert Findley <rfindley@google.com>
Auto-Submit: Robert Griesemer <gri@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Robert Griesemer <gri@google.com>
src/internal/types/testdata/fixedbugs/issue50729b.go [new file with mode: 0644]

diff --git a/src/internal/types/testdata/fixedbugs/issue50729b.go b/src/internal/types/testdata/fixedbugs/issue50729b.go
new file mode 100644 (file)
index 0000000..bc1f440
--- /dev/null
@@ -0,0 +1,15 @@
+// -gotypesalias=1
+
+// Copyright 2023 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 d[T any] struct{}
+type (
+       b d[a]
+)
+
+type a = func(c)
+type c struct{ a }