]> Cypherpunks repositories - gostls13.git/commit
go/types: extend cycle detection past simple type cycles
authorRobert Griesemer <gri@golang.org>
Mon, 4 Jun 2018 22:42:12 +0000 (15:42 -0700)
committerRobert Griesemer <gri@golang.org>
Thu, 7 Jun 2018 22:04:21 +0000 (22:04 +0000)
commitd8a1465ca8d5c27215e5bdd2d776af743f74b928
treea1cc47c77d190fbab95771c98b2f943c72c3d5ad
parent19f3794c00252db3363eb649bc73bad66a2c583a
go/types: extend cycle detection past simple type cycles

This change improves upon cycle detection by taking into account
cycles involving constants, variables, _and_ types. All new code
(except for the additional tests) is guarded by the useCycleMarking
(internal) flag and thus can be disabled on short notice if it
introduced new problems. (The intent is to remove this flag shortly
after 1.11 is released.)

The test suite has been extended with various additional (and mostly
esoteric) test cases which now correctly report cycles. A handful of
existing test cases now report additional errors, but those are mostly
esoteric cases. Overall, this is an improvement over the status quo.

Fixes #8699.
For #20770.

Change-Id: I6086719acd0d5200edca4a3dbe703d053496af31
Reviewed-on: https://go-review.googlesource.com/116815
Run-TryBot: Robert Griesemer <gri@golang.org>
Reviewed-by: Alan Donovan <adonovan@google.com>
src/go/types/decl.go
src/go/types/testdata/cycles2.src
src/go/types/testdata/cycles3.src
src/go/types/testdata/cycles5.src
src/go/types/testdata/decls0.src
src/go/types/testdata/issues.src