Open adonovan opened 1 month ago
Related Issues and Documentation
(Emoji vote if this was helpful or unhelpful; more detailed feedback welcome in this discussion.)
This is mysterious. The crash is in go/types.(*Scope).Lookup
on this line:
func (s *Scope) Lookup(name string) Object {
obj := resolve(name, s.elems[name])
if obj == universeAnyAlias && !aliasAny() { // <---------- panic
return universeAnyNoAlias
}
return obj
}
but the only way that line can panic (short of a compiler error that causes the wrong line to be reported) is if obj
is a types.Object
value of the same concrete type as universeAnyAlias
and that concrete type does not support ==
comparison. However, universeAnyAlias
clearly has type *TypeName
, a pointer, which supports ==
comparison. (And presumably resolve
also returns only pointers to various struct types).
I do not understand how this crash is possible, and so suggest that we move it to the next milestone and see if it reoccurs in v0.17.0.
@dr2chase Got any ideas how this crash could possibly occur?
Issue created by stacks.
This stack
l9BGAQ
was reported by telemetry:crash/crash
runtime.gopanic:+69
runtime.panicmem:=262
runtime.sigpanic:+19
go/types.(*Scope).Lookup:+10
golang.org/x/tools/gopls/internal/golang.lookupObjectByName:+4
golang.org/x/tools/gopls/internal/golang.parseDocLink:+58
golang.org/x/tools/gopls/internal/golang.hover:+43
golang.org/x/tools/gopls/internal/golang.Hover:+4
golang.org/x/tools/gopls/internal/server.(*server).Hover:+30
golang.org/x/tools/gopls/internal/protocol.serverDispatch:+335
golang.org/x/tools/gopls/internal/lsprpc.(*streamServer).ServeStream.ServerHandler.func3:+5
golang.org/x/tools/gopls/internal/lsprpc.(*streamServer).ServeStream.handshaker.func4:+52
golang.org/x/tools/gopls/internal/protocol.Handlers.MustReplyHandler.func1:+2
golang.org/x/tools/gopls/internal/protocol.Handlers.AsyncHandler.func2.2:+3
runtime.goexit:+0