Skip to content

x/tools/go/analysis/passes/assign: unsound quickfix (deletes too much) #74013

Open
@adonovan

Description

@adonovan

The suggested fix reported by the assign analyzer for x = x or x, y = x, 0 deletes the entire statement. That's fine in the first case, but in the second it removes the assignment to y.

The correct fix is to remove only one LHS, RHS pair in the case of a parallel assignment.

Also, it should set Diagnostic.End appropriately.

Metadata

Metadata

Assignees

No one assigned

    Labels

    NeedsFixThe path to resolution is known, but the work has not been done.ToolsThis label describes issues relating to any tools in the x/tools repository.

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions