We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent eb71987 commit 0098023Copy full SHA for 0098023
internal/lsp/source/util.go
@@ -221,12 +221,17 @@ func FormatNode(fset *token.FileSet, n ast.Node) string {
221
222
// Deref returns a pointer's element type, traversing as many levels as needed.
223
// Otherwise it returns typ.
224
+//
225
+// It can return a pointer type if the type refers to itself (see golang/go#45510).
226
func Deref(typ types.Type) types.Type {
227
for {
228
p, ok := typ.Underlying().(*types.Pointer)
229
if !ok {
230
return typ
231
}
232
+ if typ == p.Elem() {
233
+ return typ
234
+ }
235
typ = p.Elem()
236
237
0 commit comments