aboutsummaryrefslogtreecommitdiff
path: root/src/runtime/testdata
diff options
context:
space:
mode:
authorRobert Griesemer <gri@google.com>2025-11-03 16:54:43 -0800
committerGopher Robot <gobot@golang.org>2025-11-13 11:39:17 -0800
commit57362e98140bdb964d05017690fb0aba37af6b48 (patch)
treeb801790c28eaafebceacf3f789c0955265f4f2a9 /src/runtime/testdata
parent099e0027bd7d282c400b1f5930d19a4652a265eb (diff)
downloadgo-57362e98140bdb964d05017690fb0aba37af6b48.tar.xz
go/types, types2: check for direct cycles as a separate phase
A direct cycle is the most basic form of cycle, where no type literal or predeclared type is reached. It is formed by a series of only TypeNames. To illustrate, type T T is a direct cycle, but type T [1]T and type T *T are not. Likewise, the below is also a direct cycle: type A B type B C type C = A Direct cycles are handled explicitly as part of resolveUnderlying, since they are the only cycle which can prevent reaching an underlying type. If we move this check to an earlier compiler phase, we can simplify resolveUnderlying. This is the first of (hopefully) several cycle kinds to be moved into a preliminary phase, with the goal of simplifying the main type-checking pass. For that reason, the bulk of the logic is placed in cycles.go. CL based on an earlier version by Mark Freeman. Change-Id: I3044c383278deb6acb8767c498d8cb68099ba8ef Reviewed-on: https://go-review.googlesource.com/c/go/+/717343 Auto-Submit: Robert Griesemer <gri@google.com> Reviewed-by: Mark Freeman <markfreeman@google.com> Reviewed-by: Robert Griesemer <gri@google.com> LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Diffstat (limited to 'src/runtime/testdata')
0 files changed, 0 insertions, 0 deletions