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
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:
Add new tests for object resolution driven by source files with
declarations and uses marked via special comments. This made it easier
to add test coverage while refactoring object resolution for #45104.
Tests are added to a new resolver_test.go file. In a subsequent CL the
resolver.go file will be added, making this choice of file name more
sensible.
For #45104
For #45136
For #45160
Change-Id: I240fccc0de95aa8f2d03e39c77146d4c61f1ef9e
Reviewed-on: https://go-review.googlesource.com/c/go/+/304450
Trust: Robert Findley <rfindley@google.com>
Trust: Robert Griesemer <gri@golang.org>
Run-TryBot: Robert Findley <rfindley@google.com>
Reviewed-by: Robert Griesemer <gri@golang.org>
TryBot-Result: Go Bot <gobot@golang.org>
Object resolution in go/types is more accurate than the purely syntactic
object resolution in go/parser (for example, golang/go#45160), and spans
multiple files. Use it for more accurate diagnostics in the loopclosure
analyzer.
Change-Id: I2160876dd4b3fd83aa07a9da971f27c17d7d6043
Reviewed-on: https://go-review.googlesource.com/c/tools/+/432137
Run-TryBot: Robert Findley <rfindley@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
gopls-CI: kokoro <noreply+kokoro@google.com>
Reviewed-by: Alan Donovan <adonovan@google.com>
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
The text was updated successfully, but these errors were encountered: