Skip to content

NoPrematureLetComputation doesn't move multiple destructured elements #18

@jfmengels

Description

@jfmengels

Currently the rule only reports destructured let elements when there is only a single variable being created

let
  -- is moved correctly
  (A a) = ...
  -- are not being moved
  ( b, c ) = ...
  { d } = ...
in
if doNothing then
  ()
else
  a + b + c + d

Example of things the rule would not report:

These declarations should only be moved if ALL of their variables can be moved to the same location where they can be closer to where they're being used.

let
  -- should not be moved because `b` shouldn't be moved
  ( b, c ) = ...
in
if doNothing then
  b
else
  b + c

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or requesthelp wantedExtra attention is needed

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions