#!stacks
"gopanic" && "ZeroExpr" && "createUndeclared" && "ApplyFix"
Issue created by stacks.
Not sure how TypesFromContext can return a Tuple type, but that function could use a clearer theory, better documentation, and comprehensive tests.
This stack Ja7blg
was reported by telemetry:
crash/crash
runtime.gopanic:+69,+0x167
golang.org/x/tools/internal/typesinternal.ZeroExpr:+68,+0x838
golang.org/x/tools/gopls/internal/golang.createUndeclared:+75,+0x484
golang.org/x/tools/gopls/internal/golang.ApplyFix.singleFile.func10:+1,+0x23
golang.org/x/tools/gopls/internal/golang.ApplyFix:+43,+0x702
golang.org/x/tools/gopls/internal/server.(*commandHandler).ApplyFix.func1:+1,+0x85
golang.org/x/tools/gopls/internal/server.(*commandHandler).run.func2:+3,+0x86
golang.org/x/tools/gopls/internal/server.(*commandHandler).run:+81,+0x582
golang.org/x/tools/gopls/internal/server.(*commandHandler).ApplyFix:+2,+0x19c
golang.org/x/tools/gopls/internal/protocol/command.Dispatch:+31,+0xac1
golang.org/x/tools/gopls/internal/server.(*server).ResolveCodeAction:+21,+0x1b8
golang.org/x/tools/gopls/internal/protocol.serverDispatch:+46,+0xcf9
golang.org/x/tools/gopls/internal/lsprpc.(*streamServer).ServeStream.ServerHandler.func4:+5,+0x84
golang.org/x/tools/gopls/internal/lsprpc.(*streamServer).ServeStream.handshaker.func5:+52,+0x908
golang.org/x/tools/gopls/internal/protocol.Handlers.MustReplyHandler.func1:+2,+0xc5
golang.org/x/tools/gopls/internal/protocol.Handlers.AsyncHandler.func2.2:+3,+0x95
golang.org/x/tools/gopls@v0.19.1 go1.24.3 linux/amd64 other,vscode (1)
Comment From: gabyhelp
Related Issues
- x/tools/gopls: Completion: "ZeroString for unexpected type" panic #70744 (closed)
- x/tools/gopls: Implementation (by signatures): nil panic in dynamicFuncCallType #74305 (closed)
- x/tools/gopls: analysisinternal.ZeroValue crash on (presumably) unsafe.Pointer #70585 (closed)
- x/tools/gopls: completion: failed type assertion in inferExpectedTypeArg #70889 (closed)
- x/tools/gopls: OOB index crash in completion.expectedReturnStmtType #70636 (closed)
- x/tools/gopls: Completion: nil deref in expectedCompositeLiteralType #72136 (closed)
- x/tools/gopls: Rename: crash due to Info.Defs[id]=nil bug in checkStructField #70968 (closed)
- x/tools/gopls: nil deref in x/telemetry/internal/counter.(*Counter).add #73890
- x/tools/gopls: ChangeSignature: OOB panic in inlineCall (FuncType.Params inconsistent with Signature) #73912 (closed)
- x/tools/gopls: stubmethods: nil deref of FuncType.Results in fromReturnStmt #70967 (closed)
(Emoji vote if this was helpful or unhelpful; more detailed feedback welcome in this discussion.)