diff options
author | Matthew Dempsky <mdempsky@google.com> | 2024-05-14 22:22:34 -0700 |
---|---|---|
committer | Gopher Robot <gobot@golang.org> | 2024-05-15 15:09:14 +0000 |
commit | 31c81500828993d99af3392742abde64194da858 (patch) | |
tree | 4057627201089f1bc5179769b824a4698bdb5d28 /test/fixedbugs | |
parent | c3c97ad1bf3ca5bac682df068f7e0384029839b1 (diff) | |
download | go-31c81500828993d99af3392742abde64194da858.tar.gz go-31c81500828993d99af3392742abde64194da858.zip |
cmd/compile/internal/noder: enable type aliases in type checker
This CL fixes an initialization loop during IR construction, that
stems from IR lacking first-class support for aliases. As a
workaround, we avoid publishing alias declarations until the RHS type
expression has been constructed.
Thanks to gri@ for investigating while I was out.
Fixes #66873.
Change-Id: I11e0d96ea6c357c295da47f44b6ec408edef89b7
Reviewed-on: https://go-review.googlesource.com/c/go/+/585399
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
Reviewed-by: Cuong Manh Le <cuong.manhle.vn@gmail.com>
Auto-Submit: Matthew Dempsky <mdempsky@google.com>
Diffstat (limited to 'test/fixedbugs')
-rw-r--r-- | test/fixedbugs/issue66873.go | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/test/fixedbugs/issue66873.go b/test/fixedbugs/issue66873.go new file mode 100644 index 0000000000..2f49cc933d --- /dev/null +++ b/test/fixedbugs/issue66873.go @@ -0,0 +1,15 @@ +// compile + +// 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 + +func f(A) {} + +type T int + +type A = T + +func (A) m() {} |