diff options
author | Teddy Wing | 2024-03-09 21:20:32 +0100 |
---|---|---|
committer | Teddy Wing | 2024-03-09 21:20:32 +0100 |
commit | b1b311caf11e9e88ef5735dc4e5512dcd4725059 (patch) | |
tree | d7704a3bd6743863d548c29d611ca37f6a814380 /testdata/struct_reference.go | |
parent | f923099c4302e49a1563183c5217e1e5cf017d85 (diff) | |
download | gocapturedrefrace-b1b311caf11e9e88ef5735dc4e5512dcd4725059.tar.bz2 |
Fiddle with `pos` in `funcScope.LookupParent` for Go 1.22 breakage
First I tried changing `funcScope.LookupParent` to use the starting
brace ("{") of the function, but that didn't work for redeclarations:
$ go test -v
analysistest.go:522: gocapturedrefrace/testdata/shadow.go:38:6: unexpected diagnostic: captured reference err in goroutine closure
analysistest.go:522: gocapturedrefrace/testdata/shadow.go:39:14: unexpected diagnostic: captured reference err in goroutine closure
analysistest.go:522: gocapturedrefrace/testdata/shadow.go:47:3: unexpected diagnostic: captured reference err in goroutine closure
analysistest.go:522: gocapturedrefrace/testdata/shadow.go:48:6: unexpected diagnostic: captured reference err in goroutine closure
analysistest.go:522: gocapturedrefrace/testdata/shadow.go:49:14: unexpected diagnostic: captured reference err in goroutine closure
analysistest.go:522: gocapturedrefrace/testdata/shadow.go:66:3: unexpected diagnostic: captured reference err1 in goroutine closure
analysistest.go:522: gocapturedrefrace/testdata/shadow.go:67:3: unexpected diagnostic: captured reference err2 in goroutine closure
analysistest.go:522: gocapturedrefrace/testdata/shadow.go:68:6: unexpected diagnostic: captured reference err1 in goroutine closure
analysistest.go:522: gocapturedrefrace/testdata/shadow.go:68:21: unexpected diagnostic: captured reference err2 in goroutine closure
analysistest.go:522: gocapturedrefrace/testdata/shadow.go:69:14: unexpected diagnostic: captured reference err1 in goroutine closure
analysistest.go:522: gocapturedrefrace/testdata/shadow.go:69:20: unexpected diagnostic: captured reference err2 in goroutine closure
--- FAIL: Test (0.43s)
The commit that breaks the analyzer says:
> Previously, its value was unset (NoPos), but the correct
> value is a point after the signature (FuncType.End) and
> before the body.
(https://github.com/golang/go/commit/a27a525d1b4df74989ac9f6ad10394391fe3eb88)
Recalling that, I tried setting the position to `token.NoPos`, which
fixes the analyser and allows the tests to pass.
Diffstat (limited to 'testdata/struct_reference.go')
0 files changed, 0 insertions, 0 deletions