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
CL 503438 added a workaround for de-duplicating struct fields created from export data. Unfortunately, #61670 highlighted that this workaround is insufficient. At the very least, the following is an example of where the objectpath algorithm is insufficient to prevent de-duplication, when the field is forwarded from an instantiated type. There is no path to the synthetic field:
// package a
type A[P any] struct{ F P }
// package b
type B[P any] a.A[int]
Therefore, we simply can't rely on this algorithm to prevent de-duplication. We should either remove it entirely, or leave it in merely as a memory optimization. But our algorithms for references/renaming cannot depend on it.
The text was updated successfully, but these errors were encountered:
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
Jul 31, 2023
As reported in golang/go#61674, there are certain cases involving
instantiated fields that simply can't be encoded using objectpaths.
Therefore, the workaround is fundamentally insufficient, and should
probably be removed or made irrelevant (golang/go#61674). In the
meantime, update commentary and remove the bug report.
Update the gopls regression test for this behavior to exercise the
objectpath failure. While at it, ensure that the marker regtests panic
on bugs, like all other regtests. This ran into an existing imprecise
bug report, which is amended.
Updates golang/go#61674
Change-Id: I0eaea00d46cec88ac4c20cebdde805a7db3a33ad
Reviewed-on: https://go-review.googlesource.com/c/tools/+/514575
gopls-CI: kokoro <noreply+kokoro@google.com>
Run-TryBot: Robert Findley <rfindley@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Auto-Submit: Robert Findley <rfindley@google.com>
Reviewed-by: Hyang-Ah Hana Kim <hyangah@gmail.com>
CL 503438 added a workaround for de-duplicating struct fields created from export data. Unfortunately, #61670 highlighted that this workaround is insufficient. At the very least, the following is an example of where the objectpath algorithm is insufficient to prevent de-duplication, when the field is forwarded from an instantiated type. There is no path to the synthetic field:
Therefore, we simply can't rely on this algorithm to prevent de-duplication. We should either remove it entirely, or leave it in merely as a memory optimization. But our algorithms for references/renaming cannot depend on it.
The text was updated successfully, but these errors were encountered: