Skip to content

Immutability analyzer doesn't see destructuring assignments #738

@j3parker

Description

@j3parker
[Immutable]
public sealed class Whatever {
  private readonly object x;

  public Whatever() {
    x = new object(); // ok
    (x) = new ValueTuple<object>(new List<string>()); // needs to be caught
  }
}

while we're here, add a test case for the left hand side being parenthesized but not destructuring:

image

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions