Skip to content

Local variable for parameter destructuring appears in wrong location, if variable is used as spread parameter #1177

@GlassBricks

Description

@GlassBricks

See the following:
https://typescripttolua.github.io/play#code/JYOwLgpgTgZghgYwgAgGIHt3IN4ChkHJwBcRIAngNoC6uAvrowPRPIA26CcbyAbnFGBwARmxRwiAB0kQBAZ2ShkYABYoA7lHQgA5skltEEXAm1ywyALZxJyALzIAFNjh1SGdAEp7APhz5CKAgwAFcoECdPOx9TEDl0MQA6Dh1HRPS4bxZkCAAPOEsDFHQYZE1tPWEIFTheYHQoABpFUq5JUKDFCIQOOTDjBhMzCxgQkAQARnsrG2cSZEoJ6jpPIbiRsYQAJmnrSTnSSi3l1dHxicdTza3LoA

In this specific scenario that I actually encountered in one of my projects:

  • A parameter in a function is destructured
  • The destructured variable is used as a spread parameter

Then the variable declaration for the destructured parameter is declared in the wrong scope.

This occurs since v1.2.0, not in v1.1.0.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions