-
Notifications
You must be signed in to change notification settings - Fork 17.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
x/tools/gopls: Completion: failed type assertion in completer.item #71044
Comments
See amap.zip for a repro test case, courtesy of @qiulaidongfeng. |
@qiulaidongfeng do you recall exactly what you were completing when you encountered this crash? |
Nevermind: I can construct a simple repro based on this stack. |
Change https://go.dev/cl/643016 mentions this issue: |
Yes, I was writing a method declaration at the time when writing the receiver type, line 41 of amap.zip I can reproduce it. [Error - 08:07:57] 2025/01/16 08:07:57 imports fixes: allImportsFixes: D:\file\gofile\amap2\amap\uint64.go:41:18: expected '(', found newline (and 2 more errors) panic: interface conversion: *types.Basic is not typesinternal.NamedOrAlias: missing method Obj goroutine 12912 gp=0xc00654fc00 m=0 mp=0x25a5100 [running]: |
Issue created by stacks.
This stack
kzwYeg
was reported by telemetry:crash/crash
runtime.gopanic:+69
runtime.getitab:+58
runtime.typeAssert:+7
golang.org/x/tools/gopls/internal/golang/completion.(*completer).item:+33
golang.org/x/tools/gopls/internal/golang/completion.(*completer).addCandidate:+44
golang.org/x/tools/gopls/internal/golang/completion.(*completer).deepSearch:+71
golang.org/x/tools/gopls/internal/golang/completion.Completion:+158
golang.org/x/tools/gopls/internal/server.(*server).Completion:+19
golang.org/x/tools/gopls/internal/protocol.serverDispatch:+193
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
The text was updated successfully, but these errors were encountered: