go icon indicating copy to clipboard operation
go copied to clipboard

x/tools/gopls: Rename: missing type for selector in satisfy.(*Finder).expr

Open adonovan opened this issue 10 months ago • 14 comments

#!stacks
"runtime.sigpanic" && "satisfy.(*Finder).expr:+75"

Issue created by stacks.

	case *ast.SelectorExpr:
		if _, ok := f.info.Selections[e]; ok {
			f.expr(e.X) // selection
		} else {
			return f.info.Uses[e.Sel].Type() // qualified identifier                 <----------- panic 
		}

This is related to https://github.com/golang/go/issues/71572 and https://github.com/golang/go/issues/73109: satisfy was called on ill-typed code; and the resolution is the same: wait for https://github.com/golang/go/issues/70638.

This stack kscqug was reported by telemetry:

golang.org/x/tools/[email protected] go1.23.2 darwin/arm64 vscode (1)

Dups: bgW9pQ aibuLA aJ9H_w x0Q4yQ 7x8J4g 9tBQQA EqiNlQ ae1P8Q jxCFrw lpgZrA P3nHGA CjT0cQ EHoAAA

adonovan avatar Feb 11 '25 16:02 adonovan

Although this issue is in the gopls/backlog milestone, it belongs in the hypothetical milestone "first gopls release after the next Go release (1.25)," since the next Go release should have implemented #70638.

jba avatar Feb 13 '25 18:02 jba

This stack x0Q4yQ was reported by telemetry:

golang.org/x/tools/[email protected] go1.24.0 windows/amd64 other,vscode (2)

This stack 7x8J4g was reported by telemetry:

golang.org/x/tools/[email protected] go1.24.0 windows/amd64 other,vscode (1)

adonovan avatar Mar 17 '25 17:03 adonovan