Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
go/types/objectpath: break cycles through type parameters in find
When searching for objects, we naively traversed through type parameter constraints. This leads to infinite recursion when there are cycles through type parameter constraints. Break these cycles by tracking type parameter names that have previously been encountered. This ensures we walk type parameter constraints at most once. Note that if the desired object was not found on the first search of the constraint, there is no need to search again. For golang/go#51717 Change-Id: Ifcdf4b138a0e95441e485bbb9ee21c01b04eaed4 Reviewed-on: https://go-review.googlesource.com/c/tools/+/393376 Trust: Robert Findley <rfindley@google.com> Run-TryBot: Robert Findley <rfindley@google.com> gopls-CI: kokoro <noreply+kokoro@google.com> TryBot-Result: Gopher Robot <gobot@golang.org> Reviewed-by: Robert Griesemer <gri@golang.org>
- Loading branch information
Showing
2 changed files
with
77 additions
and
24 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters