go/parser: composite lit fields resolve incorrectly #45160
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
Upon investigating this bug, it seems that it is a known limitation:
Will be fixed as part of #45104.
The text was updated successfully, but these errors were encountered:
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 <email@example.com> Trust: Robert Griesemer <firstname.lastname@example.org> Run-TryBot: Robert Findley <email@example.com> Reviewed-by: Robert Griesemer <firstname.lastname@example.org> TryBot-Result: Go Bot <email@example.com>