Open findleyr opened 3 years ago
Change https://golang.org/cl/304450 mentions this issue: go/parser: add data-driven tests for object resolution
Change https://go.dev/cl/432137 mentions this issue: go/analysis/passes/loopclosure: use object resoluttion from go/types
Resolving struct fields is a known limitation of go/parser object resolution. However, there is an additional bug that composite lit fields may be incorrectly resolved to unrelated declarations in the package scope. For example:
The mklink field identifier will be incorrectly resolved to the mklink function (found in
os/os_windows_test.go
).Upon investigating this bug, it seems that it is a known limitation: https://cs.opensource.google/go/go/+/master:src/go/parser/parser.go;l=1610;drc=0bd308ff27822378dc2db77d6dd0ad3c15ed2e08
Will be fixed as part of #45104.
CC @griesemer