-
Notifications
You must be signed in to change notification settings - Fork 18.3k
Closed
Labels
NeedsInvestigationSomeone must examine and confirm this is a valid issue and not a duplicate of an existing one.Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.ToolsThis label describes issues relating to any tools in the x/tools repository.This label describes issues relating to any tools in the x/tools repository.goplsIssues related to the Go language server, gopls.Issues related to the Go language server, gopls.gopls/telemetry-wins
Milestone
Description
#!stacks
"runtime.goPanicIndex" && "go/types.(*Tuple).At" && "completion.expectedReturnStmtType"
Issue created by stacks.
// expectedReturnStmtType returns the expected type of a return statement.
// Returns nil if enclosingSig is nil.
func expectedReturnStmtType(enclosingSig *types.Signature, node *ast.ReturnStmt, pos token.Pos) types.Type {
if enclosingSig != nil {
if resultIdx := exprAtPos(pos, node.Results); resultIdx < len(node.Results) {
return enclosingSig.Results().At(resultIdx).Type() // <--- At panics
}
}
return nil
}
This stack 69yMYw
was reported by telemetry:
crash/crash
runtime.gopanic:+69
runtime.goPanicIndex:+2
go/types.(*Tuple).At:=34
golang.org/x/tools/gopls/internal/golang/completion.expectedReturnStmtType:+3
golang.org/x/tools/gopls/internal/golang/completion.expectedCandidate:+37
golang.org/x/tools/gopls/internal/golang/completion.Completion:+150
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
golang.org/x/tools/gopls@v0.17.0-pre.3 go1.23.2 linux/amd64 other,vscode (5)
Metadata
Metadata
Assignees
Labels
NeedsInvestigationSomeone must examine and confirm this is a valid issue and not a duplicate of an existing one.Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.ToolsThis label describes issues relating to any tools in the x/tools repository.This label describes issues relating to any tools in the x/tools repository.goplsIssues related to the Go language server, gopls.Issues related to the Go language server, gopls.gopls/telemetry-wins