You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
goplsIssues related to the Go language server, gopls.NeedsFixThe path to resolution is known, but the work has not been done.ToolsThis label describes issues relating to any tools in the x/tools repository.
Seeing these errors from gopls in the workspace diagnostics list for these files.
The first error is real.
The second error is not real and should not be reported.
(The expression there is a type, not a value, so errors about copying values are confusing and wrong. Also the expected type at that point in the literal is a *T not a T, so once the first error is corrected, there will be no lock copy. Just as there is no error that T is not a *T, there should be no error that T holds a lock.)
/Users/rsc/src/rsc.io/tmp/goplsbug/x.go:8.31,8.32: T (type) is not an expression
/Users/rsc/src/rsc.io/tmp/goplsbug/x.go:8.31,8.32: literal copies lock value from T: rsc.io/tmp/goplsbug.T contains sync.Mutex
% cat go.mod
module rsc.io/tmp/goplsbug
% cat x.go
package main
import "sync"
type T struct{ mu sync.Mutex }
type T1 struct{ t *T }
func NewT1() *T1 { return &T1{T} }
%
The text was updated successfully, but these errors were encountered:
rsc
added
the
NeedsFix
The path to resolution is known, but the work has not been done.
label
Jun 3, 2024
gopherbot
added
Tools
This label describes issues relating to any tools in the x/tools repository.
gopls
Issues related to the Go language server, gopls.
labels
Jun 3, 2024
adonovan
changed the title
x/tools/gopls: spurious lock value copy errors after type check failure
x/tools/go/analysis/passes/copylock: spurious errors after type check failure
Jun 3, 2024
goplsIssues related to the Go language server, gopls.NeedsFixThe path to resolution is known, but the work has not been done.ToolsThis label describes issues relating to any tools in the x/tools repository.
Seeing these errors from gopls in the workspace diagnostics list for these files.
The first error is real.
The second error is not real and should not be reported.
(The expression there is a type, not a value, so errors about copying values are confusing and wrong. Also the expected type at that point in the literal is a *T not a T, so once the first error is corrected, there will be no lock copy. Just as there is no error that T is not a *T, there should be no error that T holds a lock.)
The text was updated successfully, but these errors were encountered: