Skip to content

x/tools/gopls/internal/golang: inline variable: nil panic in inlineVariableOne #74347

Closed
@adonovan

Description

@adonovan
#!stacks
"sigpanic" && "inlineVariableOne-range1"

Issue created by stacks.

		id := curIdent.Node().(*ast.Ident)
		obj1 := info.Uses[id]
		_, obj2 := scope.LookupParent(id.Name, pos)
		if obj1 != obj2 {
			return nil, nil, fmt.Errorf("cannot inline variable: its initializer expression refers to %q, which is shadowed by the declaration at line %d", id.Name, safetoken.Position(pgf.Tok, obj2.Pos()).Line) // <----------- obj2 is nil
		}

This stack tdbvkw was reported by telemetry:

golang.org/x/tools/gopls@v0.19.1 go1.25rc1 darwin/arm64 other,vscode (3)

Metadata

Metadata

Assignees

No one assigned

    Labels

    BugReportIssues describing a possible bug in the Go implementation.NeedsInvestigationSomeone 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.goplsIssues related to the Go language server, gopls.gopls/telemetry-wins

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions