-
Notifications
You must be signed in to change notification settings - Fork 18.5k
Open
Open
Copy link
Labels
RefactoringIssues related to refactoring toolsIssues related to refactoring toolsToolsThis 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.
Milestone
Description
gopls' unusedparams analyzer is spuriously reporting a diagnostic for an unused parameter in a func literal even when the func value is address taken, in this case by being assigned to a global variable of a particular func type:
var g func(x, y int)
func _() {
g = func(x, y int) { // unused parameter: x
print(y)
}
}The existing logic is supposed to recognize when a func lit is assigned to a func-typed var whose type it must conform to, but clearly it has a bug.
Metadata
Metadata
Assignees
Labels
RefactoringIssues related to refactoring toolsIssues related to refactoring toolsToolsThis 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.