Skip to content

x/tools/gopls: replace/mitigate objectpath workaround for struct fields #61674

Open
@findleyr

Description

@findleyr

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    ToolsThis label describes issues relating to any tools in the x/tools repository.goplsIssues related to the Go language server, gopls.

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions