go: x/tools/gopls: crash upon creating empty linked list
Here’s a hard one for you.
What version of Gopls are you using ?
$ gopls version
golang.org/x/tools/gopls v0.6.9
golang.org/x/tools/gopls@v0.6.9 h1:LBBcE2y3Tb4bp79JVLWCQBbvYCFEs5ADGWsQDoSLk1Q=
What did you do?
Create new program from scratch, write:
type a *a
var x a = a{}
or
type a *a
var x a = x
What did you expect to see?
gopls ask me why I would want to use this crazy datastructure
What did you see instead?
gopls crashes
About this issue
- Original URL
- State: closed
- Created 3 years ago
- Comments: 15 (6 by maintainers)
Commits related to this issue
- internal/lsp/source: fix an infinite loop in Deref function Return a pointer type if the type refers to itself (for example, type a *a). Fixes golang/go#45510 — committed to ShoshinNikita/tools by ShoshinNikita 3 years ago
- internal/lsp/source: fix Deref function for cyclic types The previous fix (d1362d7) is not sufficient for all cyclic types. This change updates Deref function to support more complex cases. We use a ... — committed to ShoshinNikita/tools by ShoshinNikita 3 years ago
- internal/lsp/source: fix Deref function for cyclic types The previous fix (d1362d7) is not sufficient for all cyclic types. This change updates Deref function to support more complex cases. We use a ... — committed to golang/tools by ShoshinNikita 3 years ago
I don’t think this fix is sufficient for cyclic types like: